public class AnywhereFileAPI
extends java.lang.Object
See the method AnywhereAPI.getFileAPI() to obtain an instance of the AnywhereFileAPI.
| Modifier | Constructor and Description |
|---|---|
protected |
AnywhereFileAPI(AnywhereConnector connector) |
| Modifier and Type | Method and Description |
|---|---|
ConflictListing |
listConflicts(AuthToken authToken)
List conflicts for a user
|
LinkAccessListing |
listLinkReadHistory(AuthToken authToken,
java.lang.String path,
java.lang.Boolean showPrivate,
java.lang.String pageToken,
java.lang.Integer pageSize,
PageAction pageAction)
List link read history of a file
|
ReadAccessListing |
listReadHistory(AuthToken authToken,
java.lang.String path,
java.lang.Boolean showPrivate,
java.lang.String pageToken,
java.lang.Integer pageSize,
PageAction pageAction)
List read history of a file
|
FileVersionListing |
listVersions(AuthToken authToken,
java.lang.String path,
java.lang.Boolean showPrivate,
java.lang.String pageToken,
java.lang.Integer pageSize,
PageAction pageAction)
List all versions of a file
|
Entry |
promoteVersion(AuthToken authToken,
java.lang.String path,
java.lang.String etag)
Promote a version of a file to current
|
InputStreamResult<Entry> |
read(AuthToken authToken,
java.lang.String path,
java.lang.String etag)
Deprecated.
|
Entry |
read(AuthToken authToken,
java.lang.String path,
java.lang.String etag,
java.lang.Boolean forceDownload,
java.io.OutputStream out)
Downloads the contents of the specified file and writes the contents of the file to the
specified OutputStream.
|
Entry |
read(AuthToken authToken,
java.lang.String path,
java.lang.String etag,
java.io.OutputStream out)
Downloads the contents of the specified file and writes the contents of the file to the
specified OutputStream.
|
Entry |
restore(AuthToken authToken,
java.lang.String path)
Restore a file that has been deleted
|
Entry |
update(AuthToken authToken,
java.lang.String path,
java.lang.Long size,
java.lang.String hash,
java.lang.String etag,
java.io.InputStream contentIn)
Updates an existing file at the specified path.
|
Entry |
upload(AuthToken authToken,
java.lang.String path,
java.lang.Long size,
java.lang.String hash,
boolean createParents,
java.io.InputStream contentIn)
Uploads a new file to the specified path.
|
protected AnywhereFileAPI(AnywhereConnector connector)
public Entry read(AuthToken authToken, java.lang.String path, java.lang.String etag, java.io.OutputStream out) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - path (including file name) to the file you want to downloadetag - the etag of the file to be read. If provided, and the latest version of the file
on the server matches this etag, then the file will not be downloaded. If null, or
if it does not match the etag on the server, then the file will be downloaded and
the current Entry will be returned.out - OutputStream where the contents of the file are
writtenEntry downloaded is returned. (However, calling
Entry.getParent() on the returned Entry will
return null.) If no data was downloaded (because the etag matched), then null is
returned.AwUnsupportedApiVersionException - if this method is
not supported by the server due to the server's supported API versionsAwNotFoundException - if path does not existAwConflictException - if path is a folder, not a filejava.io.IOExceptionAnywhereExceptionpublic Entry read(AuthToken authToken, java.lang.String path, java.lang.String etag, java.lang.Boolean forceDownload, java.io.OutputStream out) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - path (including file name) to the file you want to downloadetag - the etag of the file to be read.forceDownload. - if true, the version associated with an included etag will always be
downloaded, regardless of whether it matches the latest version of the file on the
server.out - OutputStream where the contents of the file are
writtenEntry downloaded is returned. (However, calling
Entry.getParent() on the returned Entry will
return null.) If no data was downloaded (because the etag matched), then null is
returned.AwUnsupportedApiVersionException - if this method is
not supported by the server due to the server's supported API versionsAwNotFoundException - if path does not existAwConflictException - if path is a folder, not a filejava.io.IOExceptionAnywhereException@Deprecated public InputStreamResult<Entry> read(AuthToken authToken, java.lang.String path, java.lang.String etag) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
InputStreamResult containing the Entry that is
being read and an InputStream that contains the contents of the file to read. If etag is
provided and matches the etag on the server, then the file will not be downloaded (as it is
unchanged), and null is returned.
Note that care must be taken by callers of this method to close the InputStream returned.
This method is deprecated, as the preferable means of downloading a file is via
read(com.hds.hcpaw.fss.api.model.AuthToken, String, String, java.io.OutputStream).
authToken - authentication token for the user performing the requestpath - path (including file name) to the file you want to downloadetag - the etag of the file to be read. If provided, and the latest version of the file
on the server matches this etag, then the file will not be downloaded. If null, or
if it does not match the etag on the server, then the file will be downloaded and
the current Entry will be returned.Entry downloaded
is returned. (However, calling Entry.getParent()
on the returned Entry will return null.) If no data was downloaded (because the etag
matched), then null is returned.AwUnsupportedApiVersionException - if this method is
not supported by the server due to the server's supported API versionsAwNotFoundException - if path does not existAwConflictException - if path is a folder, not a filejava.io.IOExceptionAnywhereExceptionpublic Entry upload(AuthToken authToken, java.lang.String path, java.lang.Long size, java.lang.String hash, boolean createParents, java.io.InputStream contentIn) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - path (including file name) where the file is uploadedsize - size (in bytes) of the file being uploaded.hash - the SHA-384 hash, represented as a hex string, of the file being uploaded. This
argument is optionalcreateParents - if true, then any parent folders of path that do not already exist will
be created. if false, then the operation will fail if any parent folders of path
do not existcontentIn - InputStream containing the new file contents.AwUnsupportedApiVersionException - if this method is
not supported by the server due to the server's supported API versionsAwNotFoundException - if the parent of path does not
exist and createParents is falseAwInvalidRequestException - if the request is invalid;
for example, because the size or hash does not match the contents sent.AwConflictException - if a folder currently exists at
path, or if a file currently exists at path with a different size and hashjava.io.IOExceptionAnywhereExceptionpublic Entry update(AuthToken authToken, java.lang.String path, java.lang.Long size, java.lang.String hash, java.lang.String etag, java.io.InputStream contentIn) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - path (including file name) where the file is being updatedsize - size (in bytes) of the file being uploaded.hash - the SHA-384 hash, represented as a hex string, of the file being uploaded. This
argument is optionaletag - the etag of the file you are updating. The operation fails if there is not a file
with this etag at the given pathcontentIn - InputStream containing the new file contentsAwUnsupportedApiVersionException - if this method is
not supported by the server due to the server's supported API versionsAwNotFoundException - if the parent of path does not
exist and createParents is falseAwInvalidRequestException - if the request is invalid;
for example, because the size or hash does not match the contents sent.AwConflictException - if the etag does not match the
current etag on the server, or if path refers to a folder instead of a filejava.io.IOExceptionAnywhereExceptionpublic FileVersionListing listVersions(AuthToken authToken, java.lang.String path, java.lang.Boolean showPrivate, java.lang.String pageToken, java.lang.Integer pageSize, PageAction pageAction) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - Path to the fileshowPrivate - if true, show private history, else shared historypageToken - Token stringpageSize - Number of entries to returnpageAction - Which versions to returnAwUnsupportedApiVersionExceptionjava.io.IOExceptionAnywhereExceptionpublic ReadAccessListing listReadHistory(AuthToken authToken, java.lang.String path, java.lang.Boolean showPrivate, java.lang.String pageToken, java.lang.Integer pageSize, PageAction pageAction) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - Path to the fileshowPrivate - if true, show private history, else shared historypageToken - Token stringpageSize - Number of entries to returnpageAction - Which history to returnAwUnsupportedApiVersionExceptionjava.io.IOExceptionAnywhereExceptionpublic LinkAccessListing listLinkReadHistory(AuthToken authToken, java.lang.String path, java.lang.Boolean showPrivate, java.lang.String pageToken, java.lang.Integer pageSize, PageAction pageAction) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - Path to the fileshowPrivate - if true, show private history, else shared historypageToken - Token stringpageSize - Number of entries to returnpageAction - Which history to returnAwUnsupportedApiVersionExceptionjava.io.IOExceptionAnywhereExceptionpublic Entry promoteVersion(AuthToken authToken, java.lang.String path, java.lang.String etag) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - Path to the fileetag - etag associated with the version of file to promote to currentAwUnsupportedApiVersionExceptionjava.io.IOExceptionAnywhereExceptionpublic Entry restore(AuthToken authToken, java.lang.String path) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestpath - Path to the fileAwUnsupportedApiVersionExceptionjava.io.IOExceptionAnywhereExceptionpublic ConflictListing listConflicts(AuthToken authToken) throws AwUnsupportedApiVersionException, java.io.IOException, AnywhereException
authToken - authentication token for the user performing the requestAnywhereExceptionjava.io.IOExceptionAwUnsupportedApiVersionException