public interface File extends Service, FileTypes
File
interface provides methods for accessing files within an update
session.
After an update session is created against a library item, the
File
interface can be used to make changes to the underlying library
item metadata as well as the content of the files. The following changes can be
made:
The above changes are not applied or visible until the session is
completed. See UpdateSession
.
FileTypes.AddSpec, FileTypes.Info, FileTypes.SourceType, FileTypes.ValidationError, FileTypes.ValidationResult
Modifier and Type | Method and Description |
---|---|
FileTypes.Info |
add(java.lang.String updateSessionId,
FileTypes.AddSpec fileSpec)
Requests file content to be changed (either created, or updated).
|
void |
add(java.lang.String updateSessionId,
FileTypes.AddSpec fileSpec,
AsyncCallback<FileTypes.Info> asyncCallback)
Requests file content to be changed (either created, or updated).
|
void |
add(java.lang.String updateSessionId,
FileTypes.AddSpec fileSpec,
AsyncCallback<FileTypes.Info> asyncCallback,
InvocationConfig invocationConfig)
Requests file content to be changed (either created, or updated).
|
FileTypes.Info |
add(java.lang.String updateSessionId,
FileTypes.AddSpec fileSpec,
InvocationConfig invocationConfig)
Requests file content to be changed (either created, or updated).
|
FileTypes.Info |
get(java.lang.String updateSessionId,
java.lang.String fileName)
Retrieves information about a specific file in the snapshot of the library item
at the time when the update session was created.
|
void |
get(java.lang.String updateSessionId,
java.lang.String fileName,
AsyncCallback<FileTypes.Info> asyncCallback)
Retrieves information about a specific file in the snapshot of the library item
at the time when the update session was created.
|
void |
get(java.lang.String updateSessionId,
java.lang.String fileName,
AsyncCallback<FileTypes.Info> asyncCallback,
InvocationConfig invocationConfig)
Retrieves information about a specific file in the snapshot of the library item
at the time when the update session was created.
|
FileTypes.Info |
get(java.lang.String updateSessionId,
java.lang.String fileName,
InvocationConfig invocationConfig)
Retrieves information about a specific file in the snapshot of the library item
at the time when the update session was created.
|
java.util.List<FileTypes.Info> |
list(java.lang.String updateSessionId)
Lists all files in the library item associated with the update session.
|
void |
list(java.lang.String updateSessionId,
AsyncCallback<java.util.List<FileTypes.Info>> asyncCallback)
Lists all files in the library item associated with the update session.
|
void |
list(java.lang.String updateSessionId,
AsyncCallback<java.util.List<FileTypes.Info>> asyncCallback,
InvocationConfig invocationConfig)
Lists all files in the library item associated with the update session.
|
java.util.List<FileTypes.Info> |
list(java.lang.String updateSessionId,
InvocationConfig invocationConfig)
Lists all files in the library item associated with the update session.
|
void |
remove(java.lang.String updateSessionId,
java.lang.String fileName)
Requests a file to be removed.
|
void |
remove(java.lang.String updateSessionId,
java.lang.String fileName,
AsyncCallback<java.lang.Void> asyncCallback)
Requests a file to be removed.
|
void |
remove(java.lang.String updateSessionId,
java.lang.String fileName,
AsyncCallback<java.lang.Void> asyncCallback,
InvocationConfig invocationConfig)
Requests a file to be removed.
|
void |
remove(java.lang.String updateSessionId,
java.lang.String fileName,
InvocationConfig invocationConfig)
Requests a file to be removed.
|
FileTypes.ValidationResult |
validate(java.lang.String updateSessionId)
Validates the files in the update session with the referenced identifier and
ensures all necessary files are received.
|
void |
validate(java.lang.String updateSessionId,
AsyncCallback<FileTypes.ValidationResult> asyncCallback)
Validates the files in the update session with the referenced identifier and
ensures all necessary files are received.
|
void |
validate(java.lang.String updateSessionId,
AsyncCallback<FileTypes.ValidationResult> asyncCallback,
InvocationConfig invocationConfig)
Validates the files in the update session with the referenced identifier and
ensures all necessary files are received.
|
FileTypes.ValidationResult |
validate(java.lang.String updateSessionId,
InvocationConfig invocationConfig)
Validates the files in the update session with the referenced identifier and
ensures all necessary files are received.
|
FileTypes.ValidationResult validate(java.lang.String updateSessionId)
FileTypes.ValidationResult.getMissingFiles()
set. The user can add the missing files and try re-validating. For other type of
errors, FileTypes.ValidationResult.getInvalidFiles()
will contain the list of invalid files.
Synchronous method overload. Result of the invocation will be reported as a method return value.
updateSessionId
- Identifier of the update session to validate.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.NotFound
- if no update session with the given identifier exists.NotAllowedInCurrentState
- if the update session is not in the UpdateSessionModel.State.ACTIVE
state, or if
some of the files that will be uploaded by the client aren't received correctly.FileTypes.ValidationResult validate(java.lang.String updateSessionId, InvocationConfig invocationConfig)
FileTypes.ValidationResult.getMissingFiles()
set. The user can add the missing files and try re-validating. For other type of
errors, FileTypes.ValidationResult.getInvalidFiles()
will contain the list of invalid files.
Synchronous method overload. Result of the invocation will be
reported as a method return value.
Use invocationConfig
to specify configuration for this particular invocation.
updateSessionId
- Identifier of the update session to validate.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.invocationConfig
- Configuration for the method invocation.NotFound
- if no update session with the given identifier exists.NotAllowedInCurrentState
- if the update session is not in the UpdateSessionModel.State.ACTIVE
state, or if
some of the files that will be uploaded by the client aren't received correctly.void validate(java.lang.String updateSessionId, AsyncCallback<FileTypes.ValidationResult> asyncCallback)
FileTypes.ValidationResult.getMissingFiles()
set. The user can add the missing files and try re-validating. For other type of
errors, FileTypes.ValidationResult.getInvalidFiles()
will contain the list of invalid files.
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Operation Result:
A validation result containing missing files or invalid files and the reason why
they are invalid.
Operation Errors:
NotFound
- if no update session with the given identifier exists.
NotAllowedInCurrentState
- if the update session is not in the UpdateSessionModel.State.ACTIVE
state, or if
some of the files that will be uploaded by the client aren't received correctly.
updateSessionId
- Identifier of the update session to validate.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.void validate(java.lang.String updateSessionId, AsyncCallback<FileTypes.ValidationResult> asyncCallback, InvocationConfig invocationConfig)
FileTypes.ValidationResult.getMissingFiles()
set. The user can add the missing files and try re-validating. For other type of
errors, FileTypes.ValidationResult.getInvalidFiles()
will contain the list of invalid files.
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Use invocationConfig
to specify configuration for this particular invocation.
Operation Result:
A validation result containing missing files or invalid files and the reason why
they are invalid.
Operation Errors:
NotFound
- if no update session with the given identifier exists.
NotAllowedInCurrentState
- if the update session is not in the UpdateSessionModel.State.ACTIVE
state, or if
some of the files that will be uploaded by the client aren't received correctly.
updateSessionId
- Identifier of the update session to validate.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.invocationConfig
- Configuration for the method invocation.FileTypes.Info add(java.lang.String updateSessionId, FileTypes.AddSpec fileSpec)
When importing a file directly from storage, where the source endpoint is a file or datastore URI, you will need to have the ContentLibrary.ReadStorage privilege on the library item. If the file is located in the same directory as the library storage backing folder, the server will move the file instead of copying it, thereby allowing instantaneous import of files for efficient backup and restore scenarios. In all other cases, a copy is performed rather than a move.
Synchronous method overload. Result of the invocation will be reported as a method return value.
updateSessionId
- Identifier of the update session to be modified.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileSpec
- Specification for the file that needs to be added or updated. This includes
whether the client wants to push the content or have the server pull it.FileTypes.Info
class
containing upload links as well as server side state tracking the transfer of
the file.InvalidArgument
- if the fileSpec
is invalid.NotFound
- if the update session doesn't exist.Unauthorized
- if the caller doesn't have ContentLibrary.ReadStorage privilege on the library
item of the update session and source type FileTypes.SourceType.PULL
is
requested for a file or datastore source endpoint (that is, not HTTP or HTTPs
based endpoint).NotAllowedInCurrentState
- if the content of the library item associated with the update session has been
deleted from the storage backings (see LibraryModel#storageBackings
)
associated with it.NotAllowedInCurrentState
- if metadata files such as manifest and certificate file are added after the OVF
descriptor file. This is applicable to update sessions with library item type
OVF only. This error was added in vSphere 6.8.0.FileTypes.Info add(java.lang.String updateSessionId, FileTypes.AddSpec fileSpec, InvocationConfig invocationConfig)
When importing a file directly from storage, where the source endpoint is a file or datastore URI, you will need to have the ContentLibrary.ReadStorage privilege on the library item. If the file is located in the same directory as the library storage backing folder, the server will move the file instead of copying it, thereby allowing instantaneous import of files for efficient backup and restore scenarios. In all other cases, a copy is performed rather than a move.
Synchronous method overload. Result of the invocation will be
reported as a method return value.
Use invocationConfig
to specify configuration for this particular invocation.
updateSessionId
- Identifier of the update session to be modified.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileSpec
- Specification for the file that needs to be added or updated. This includes
whether the client wants to push the content or have the server pull it.invocationConfig
- Configuration for the method invocation.FileTypes.Info
class
containing upload links as well as server side state tracking the transfer of
the file.InvalidArgument
- if the fileSpec
is invalid.NotFound
- if the update session doesn't exist.Unauthorized
- if the caller doesn't have ContentLibrary.ReadStorage privilege on the library
item of the update session and source type FileTypes.SourceType.PULL
is
requested for a file or datastore source endpoint (that is, not HTTP or HTTPs
based endpoint).NotAllowedInCurrentState
- if the content of the library item associated with the update session has been
deleted from the storage backings (see LibraryModel#storageBackings
)
associated with it.NotAllowedInCurrentState
- if metadata files such as manifest and certificate file are added after the OVF
descriptor file. This is applicable to update sessions with library item type
OVF only. This error was added in vSphere 6.8.0.void add(java.lang.String updateSessionId, FileTypes.AddSpec fileSpec, AsyncCallback<FileTypes.Info> asyncCallback)
When importing a file directly from storage, where the source endpoint is a file or datastore URI, you will need to have the ContentLibrary.ReadStorage privilege on the library item. If the file is located in the same directory as the library storage backing folder, the server will move the file instead of copying it, thereby allowing instantaneous import of files for efficient backup and restore scenarios. In all other cases, a copy is performed rather than a move.
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Operation Result:
An FileTypes.Info
class
containing upload links as well as server side state tracking the transfer of
the file.
Operation Errors:
InvalidArgument
- if the fileSpec
is invalid.
NotFound
- if the update session doesn't exist.
Unauthorized
- if the caller doesn't have ContentLibrary.ReadStorage privilege on the library
item of the update session and source type FileTypes.SourceType.PULL
is
requested for a file or datastore source endpoint (that is, not HTTP or HTTPs
based endpoint).
NotAllowedInCurrentState
- if the content of the library item associated with the update session has been
deleted from the storage backings (see LibraryModel#storageBackings
)
associated with it.
NotAllowedInCurrentState
- if metadata files such as manifest and certificate file are added after the OVF
descriptor file. This is applicable to update sessions with library item type
OVF only. This error was added in vSphere 6.8.0.
updateSessionId
- Identifier of the update session to be modified.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileSpec
- Specification for the file that needs to be added or updated. This includes
whether the client wants to push the content or have the server pull it.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.void add(java.lang.String updateSessionId, FileTypes.AddSpec fileSpec, AsyncCallback<FileTypes.Info> asyncCallback, InvocationConfig invocationConfig)
When importing a file directly from storage, where the source endpoint is a file or datastore URI, you will need to have the ContentLibrary.ReadStorage privilege on the library item. If the file is located in the same directory as the library storage backing folder, the server will move the file instead of copying it, thereby allowing instantaneous import of files for efficient backup and restore scenarios. In all other cases, a copy is performed rather than a move.
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Use invocationConfig
to specify configuration for this particular invocation.
Operation Result:
An FileTypes.Info
class
containing upload links as well as server side state tracking the transfer of
the file.
Operation Errors:
InvalidArgument
- if the fileSpec
is invalid.
NotFound
- if the update session doesn't exist.
Unauthorized
- if the caller doesn't have ContentLibrary.ReadStorage privilege on the library
item of the update session and source type FileTypes.SourceType.PULL
is
requested for a file or datastore source endpoint (that is, not HTTP or HTTPs
based endpoint).
NotAllowedInCurrentState
- if the content of the library item associated with the update session has been
deleted from the storage backings (see LibraryModel#storageBackings
)
associated with it.
NotAllowedInCurrentState
- if metadata files such as manifest and certificate file are added after the OVF
descriptor file. This is applicable to update sessions with library item type
OVF only. This error was added in vSphere 6.8.0.
updateSessionId
- Identifier of the update session to be modified.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileSpec
- Specification for the file that needs to be added or updated. This includes
whether the client wants to push the content or have the server pull it.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.invocationConfig
- Configuration for the method invocation.void remove(java.lang.String updateSessionId, java.lang.String fileName)
Synchronous method overload. Result of the invocation will be reported as a method return value.
updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileName
- Name of the file to be removed.NotFound
- if the update session doesn't exist.InvalidArgument
- if the file doesn't exist in the library item associated with the update
session.void remove(java.lang.String updateSessionId, java.lang.String fileName, InvocationConfig invocationConfig)
Synchronous method overload. Result of the invocation will be
reported as a method return value.
Use invocationConfig
to specify configuration for this particular invocation.
updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileName
- Name of the file to be removed.invocationConfig
- Configuration for the method invocation.NotFound
- if the update session doesn't exist.InvalidArgument
- if the file doesn't exist in the library item associated with the update
session.void remove(java.lang.String updateSessionId, java.lang.String fileName, AsyncCallback<java.lang.Void> asyncCallback)
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Operation Errors:
NotFound
- if the update session doesn't exist.
InvalidArgument
- if the file doesn't exist in the library item associated with the update
session.
updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileName
- Name of the file to be removed.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.void remove(java.lang.String updateSessionId, java.lang.String fileName, AsyncCallback<java.lang.Void> asyncCallback, InvocationConfig invocationConfig)
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Use invocationConfig
to specify configuration for this particular invocation.
Operation Errors:
NotFound
- if the update session doesn't exist.
InvalidArgument
- if the file doesn't exist in the library item associated with the update
session.
updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileName
- Name of the file to be removed.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.invocationConfig
- Configuration for the method invocation.java.util.List<FileTypes.Info> list(java.lang.String updateSessionId)
Synchronous method overload. Result of the invocation will be reported as a method return value.
updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.List
of the files in the library item associated with the
update session. This List
may be empty if the caller has
removed all the files as part of this session (in which case completing the
update session will result in an empty library item).NotFound
- if the update session doesn't exist.Unauthorized
- if you do not have all of the privileges described as follows: com.vmware.content.library.Item
referenced by the parameter
libraryItemId
requires System.Read
. java.util.List<FileTypes.Info> list(java.lang.String updateSessionId, InvocationConfig invocationConfig)
Synchronous method overload. Result of the invocation will be
reported as a method return value.
Use invocationConfig
to specify configuration for this particular invocation.
updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.invocationConfig
- Configuration for the method invocation.List
of the files in the library item associated with the
update session. This List
may be empty if the caller has
removed all the files as part of this session (in which case completing the
update session will result in an empty library item).NotFound
- if the update session doesn't exist.Unauthorized
- if you do not have all of the privileges described as follows: com.vmware.content.library.Item
referenced by the parameter
libraryItemId
requires System.Read
. void list(java.lang.String updateSessionId, AsyncCallback<java.util.List<FileTypes.Info>> asyncCallback)
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Operation Result:
The List
of the files in the library item associated with the
update session. This List
may be empty if the caller has
removed all the files as part of this session (in which case completing the
update session will result in an empty library item).
Operation Errors:
NotFound
- if the update session doesn't exist.
Unauthorized
- if you do not have all of the privileges described as follows:
com.vmware.content.library.Item
referenced by the parameter
libraryItemId
requires System.Read
. updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.void list(java.lang.String updateSessionId, AsyncCallback<java.util.List<FileTypes.Info>> asyncCallback, InvocationConfig invocationConfig)
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Use invocationConfig
to specify configuration for this particular invocation.
Operation Result:
The List
of the files in the library item associated with the
update session. This List
may be empty if the caller has
removed all the files as part of this session (in which case completing the
update session will result in an empty library item).
Operation Errors:
NotFound
- if the update session doesn't exist.
Unauthorized
- if you do not have all of the privileges described as follows:
com.vmware.content.library.Item
referenced by the parameter
libraryItemId
requires System.Read
. updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.invocationConfig
- Configuration for the method invocation.FileTypes.Info get(java.lang.String updateSessionId, java.lang.String fileName)
Synchronous method overload. Result of the invocation will be reported as a method return value.
updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileName
- Name of the file.NotFound
- if the update session doesn't exist.InvalidArgument
- if the file doesn't exist in the library item associated with the update
session.Unauthorized
- if you do not have all of the privileges described as follows: com.vmware.content.library.Item
referenced by the parameter
libraryItemId
requires System.Read
. FileTypes.Info get(java.lang.String updateSessionId, java.lang.String fileName, InvocationConfig invocationConfig)
Synchronous method overload. Result of the invocation will be
reported as a method return value.
Use invocationConfig
to specify configuration for this particular invocation.
updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileName
- Name of the file.invocationConfig
- Configuration for the method invocation.NotFound
- if the update session doesn't exist.InvalidArgument
- if the file doesn't exist in the library item associated with the update
session.Unauthorized
- if you do not have all of the privileges described as follows: com.vmware.content.library.Item
referenced by the parameter
libraryItemId
requires System.Read
. void get(java.lang.String updateSessionId, java.lang.String fileName, AsyncCallback<FileTypes.Info> asyncCallback)
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Operation Result:
Information about the file.
Operation Errors:
NotFound
- if the update session doesn't exist.
InvalidArgument
- if the file doesn't exist in the library item associated with the update
session.
Unauthorized
- if you do not have all of the privileges described as follows:
com.vmware.content.library.Item
referenced by the parameter
libraryItemId
requires System.Read
. updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileName
- Name of the file.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.void get(java.lang.String updateSessionId, java.lang.String fileName, AsyncCallback<FileTypes.Info> asyncCallback, InvocationConfig invocationConfig)
Asynchronous method overload. Result of the invocation will be
reported via the specified asyncCallback
.
Use invocationConfig
to specify configuration for this particular invocation.
Operation Result:
Information about the file.
Operation Errors:
NotFound
- if the update session doesn't exist.
InvalidArgument
- if the file doesn't exist in the library item associated with the update
session.
Unauthorized
- if you do not have all of the privileges described as follows:
com.vmware.content.library.Item
referenced by the parameter
libraryItemId
requires System.Read
. updateSessionId
- Identifier of the update session.
The parameter must be an identifier for the resource type: com.vmware.content.library.item.UpdateSession
.fileName
- Name of the file.asyncCallback
- Receives the status (progress, result or error) of the operation invocation.invocationConfig
- Configuration for the method invocation.