Package org.filestack
Class FileLink
java.lang.Object
org.filestack.FileLink
- All Implemented Interfaces:
Serializable
References and performs operations on an individual file.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionavTransform
(StorageOptions storeOptions, AvTransformOptions avOptions) Creates anAvTransform
object for this file using custom storage options.avTransform
(AvTransformOptions avOptions) Creates anAvTransform
object for this file using default storage options.void
delete()
Deletes a file handle.io.reactivex.Completable
Asynchronously deletes a file handle.Saves the file using the name it was uploaded with.Saves the file overriding the name it was uploaded with.io.reactivex.Single
<File> downloadAsync
(String directory) Asynchronously saves the file using the name it was uploaded with.io.reactivex.Single
<File> downloadAsync
(String directory, String filename) Asynchronously saves the file overriding the name it was uploaded with.Deprecated.okhttp3.ResponseBody
Returns the content of a file.io.reactivex.Single
<okhttp3.ResponseBody> Asynchronously returns the content of a file.boolean
imageSfw()
Determines if an image FileLink is "safe for work" using the Google Vision API.io.reactivex.Single
<Boolean> Asynchronously determines if an image FileLink is "safe for work" using the Google Vision API.Returns tags from the Google Vision API for image FileLinks.Asynchronously returns tags from Google Vision API for image FileLinks.Creates anImageTransform
object for this file.void
Replace the content of an existing file handle.io.reactivex.Completable
overwriteAsync
(String pathname) Asynchronously replace the content of an existing file handle.
-
Field Details
-
config
-
handle
-
-
Constructor Details
-
FileLink
Deprecated.FileLink objects should not be created by hand - useClient.fileLink(String)
to acquire them. This constructor is scheduled to be removed in version 1.0.0.Basic constructor for a FileLink.
-
-
Method Details
-
getContent
Returns the content of a file.- Returns:
- byte[] of file content
- Throws:
HttpException
- on error response from backendIOException
- on network failure
-
download
Saves the file using the name it was uploaded with.- Throws:
IOException
- See Also:
-
download
Saves the file overriding the name it was uploaded with.- Parameters:
directory
- location to save the file infilename
- local name for the file- Throws:
HttpException
- on error response from backendIOException
- on error creating file or network failure
-
overwrite
Replace the content of an existing file handle. Requires security to be set. Does not update the filename or MIME type.- Parameters:
pathname
- path to the file, can be local or absolute- Throws:
HttpException
- on error response from backendIOException
- on error reading file or network failure
-
delete
Deletes a file handle. Requires security to be set.- Throws:
HttpException
- on error response from backendIOException
- on network failure
-
imageTransform
Creates anImageTransform
object for this file. A transformation call isn't made directly by this method.- Returns:
ImageTransform
instance configured for this file
-
imageTags
Returns tags from the Google Vision API for image FileLinks.- Throws:
HttpException
- on error response from backendIOException
- on network failure- See Also:
-
imageSfw
Determines if an image FileLink is "safe for work" using the Google Vision API.- Throws:
HttpException
- on error response from backendIOException
- on network failure- See Also:
-
avTransform
Creates anAvTransform
object for this file using default storage options.- See Also:
-
avTransform
Creates anAvTransform
object for this file using custom storage options. A transformation call isn't made directly by this method. For both audio and video transformations.- Parameters:
storeOptions
- options for how to save the file(s) in your storage backendavOptions
- options for how ot convert the file- Returns:
ImageTransform
instance configured for this file
-
getContentAsync
public io.reactivex.Single<okhttp3.ResponseBody> getContentAsync()Asynchronously returns the content of a file.- See Also:
-
downloadAsync
Asynchronously saves the file using the name it was uploaded with.- See Also:
-
downloadAsync
Asynchronously saves the file overriding the name it was uploaded with.- See Also:
-
overwriteAsync
Asynchronously replace the content of an existing file handle. Requires security to be set. Does not update the filename or MIME type.- See Also:
-
deleteAsync
public io.reactivex.Completable deleteAsync()Asynchronously deletes a file handle. Requires security to be set.- See Also:
-
imageTagsAsync
Asynchronously returns tags from Google Vision API for image FileLinks.- See Also:
-
imageSfwAsync
Asynchronously determines if an image FileLink is "safe for work" using the Google Vision API.- See Also:
-
getConfig
Deprecated. -
getHandle
-
Client.fileLink(String)
to acquire them.