public static Resource create ( File file ) { try { String path = file . getCanonicalPath ( ) ; if ( file . isDirectory ( ) ) path = PathUtils . addTrailingSlash ( path ) ; return create ( new File ( "/" ) , path ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( "invalid file " + file , e ) ; } }
Creates a file resource from a file