Package com.microsoft.azure.batch
Class FileOperations
- java.lang.Object
-
- com.microsoft.azure.batch.FileOperations
-
- All Implemented Interfaces:
IInheritedBehaviors
public class FileOperations extends Object implements IInheritedBehaviors
Performs file-related operations on an Azure Batch account.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<BatchClientBehavior>
customBehaviors()
Gets a collection of behaviors that modify or customize requests to the Batch service.void
deleteFileFromComputeNode(String poolId, String nodeId, String fileName)
Deletes the specified file from the specified compute node.void
deleteFileFromComputeNode(String poolId, String nodeId, String fileName, Boolean recursive)
Deletes the specified file from the specified compute node.void
deleteFileFromComputeNode(String poolId, String nodeId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors)
Deletes the specified file from the specified compute node.void
deleteFileFromTask(String jobId, String taskId, String fileName)
Deletes the specified file from the specified task's directory on its compute node.void
deleteFileFromTask(String jobId, String taskId, String fileName, Boolean recursive)
Deletes the specified file from the specified task's directory on its compute node.void
deleteFileFromTask(String jobId, String taskId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors)
Deletes the specified file from the specified task's directory on its compute node.void
getFileFromComputeNode(String poolId, String nodeId, String fileName, OutputStream outputStream)
Downloads the specified file from the specified compute node.void
getFileFromComputeNode(String poolId, String nodeId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors, OutputStream outputStream)
Downloads the specified file from the specified compute node.void
getFileFromTask(String jobId, String taskId, String fileName, OutputStream outputStream)
Downloads the specified file from the specified task's directory on its compute node.void
getFileFromTask(String jobId, String taskId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors, OutputStream outputStream)
Downloads the specified file from the specified task's directory on its compute node.FileProperties
getFilePropertiesFromComputeNode(String poolId, String nodeId, String fileName)
Gets information about a file on a compute node.FileProperties
getFilePropertiesFromComputeNode(String poolId, String nodeId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors)
Gets information about a file on a compute node.FileProperties
getFilePropertiesFromTask(String jobId, String taskId, String fileName)
Gets information about a file from the specified task's directory on its compute node.FileProperties
getFilePropertiesFromTask(String jobId, String taskId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors)
Gets information about a file from the specified task's directory on its compute node.com.microsoft.azure.PagedList<NodeFile>
listFilesFromComputeNode(String poolId, String nodeId)
Lists files on the specified compute node.com.microsoft.azure.PagedList<NodeFile>
listFilesFromComputeNode(String poolId, String nodeId, Boolean recursive, DetailLevel detailLevel)
Lists files on the specified compute node.com.microsoft.azure.PagedList<NodeFile>
listFilesFromComputeNode(String poolId, String nodeId, Boolean recursive, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Lists files on the specified compute node.com.microsoft.azure.PagedList<NodeFile>
listFilesFromTask(String jobId, String taskId)
Lists the files in the specified task's directory on its compute node.com.microsoft.azure.PagedList<NodeFile>
listFilesFromTask(String jobId, String taskId, Boolean recursive, DetailLevel detailLevel)
Lists the files in the specified task's directory on its compute node.com.microsoft.azure.PagedList<NodeFile>
listFilesFromTask(String jobId, String taskId, Boolean recursive, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors)
Lists the files in the specified task's directory on its compute node.IInheritedBehaviors
withCustomBehaviors(Collection<BatchClientBehavior> behaviors)
Sets a collection of behaviors that modify or customize requests to the Batch service.
-
-
-
Method Detail
-
customBehaviors
public Collection<BatchClientBehavior> customBehaviors()
Gets a collection of behaviors that modify or customize requests to the Batch service.- Specified by:
customBehaviors
in interfaceIInheritedBehaviors
- Returns:
- A collection of
BatchClientBehavior
instances.
-
withCustomBehaviors
public IInheritedBehaviors withCustomBehaviors(Collection<BatchClientBehavior> behaviors)
Sets a collection of behaviors that modify or customize requests to the Batch service.- Specified by:
withCustomBehaviors
in interfaceIInheritedBehaviors
- Parameters:
behaviors
- The collection ofBatchClientBehavior
instances.- Returns:
- The current instance.
-
listFilesFromTask
public com.microsoft.azure.PagedList<NodeFile> listFilesFromTask(String jobId, String taskId) throws BatchErrorException, IOException
Lists the files in the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job.taskId
- The ID of the task.- Returns:
- A list of
NodeFile
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listFilesFromTask
public com.microsoft.azure.PagedList<NodeFile> listFilesFromTask(String jobId, String taskId, Boolean recursive, DetailLevel detailLevel) throws BatchErrorException, IOException
Lists the files in the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job.taskId
- The ID of the task.recursive
- If true, performs a recursive list of all files of the task. If false or null, returns only the files in the root task directory.detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.- Returns:
- A list of
NodeFile
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listFilesFromTask
public com.microsoft.azure.PagedList<NodeFile> listFilesFromTask(String jobId, String taskId, Boolean recursive, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Lists the files in the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job.taskId
- The ID of the task.recursive
- If true, performs a recursive list of all files of the task. If false or null, returns only the files in the root task directory.detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- A list of
NodeFile
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listFilesFromComputeNode
public com.microsoft.azure.PagedList<NodeFile> listFilesFromComputeNode(String poolId, String nodeId) throws BatchErrorException, IOException
Lists files on the specified compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- The ID of the compute node.- Returns:
- A list of
NodeFile
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listFilesFromComputeNode
public com.microsoft.azure.PagedList<NodeFile> listFilesFromComputeNode(String poolId, String nodeId, Boolean recursive, DetailLevel detailLevel) throws BatchErrorException, IOException
Lists files on the specified compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- The ID of the compute node.recursive
- If true, recursively lists all files on the compute node. If false or null, lists only the files in the compute node root directory.detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.- Returns:
- A list of
NodeFile
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
listFilesFromComputeNode
public com.microsoft.azure.PagedList<NodeFile> listFilesFromComputeNode(String poolId, String nodeId, Boolean recursive, DetailLevel detailLevel, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Lists files on the specified compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- The ID of the compute node.recursive
- If true, recursively lists all files on the compute node. If false or null, lists only the files in the compute node root directory.detailLevel
- ADetailLevel
used for filtering the list and for controlling which properties are retrieved from the service.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- A list of
NodeFile
objects. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteFileFromTask
public void deleteFileFromTask(String jobId, String taskId, String fileName) throws BatchErrorException, IOException
Deletes the specified file from the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.fileName
- The name of the file to delete.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteFileFromTask
public void deleteFileFromTask(String jobId, String taskId, String fileName, Boolean recursive) throws BatchErrorException, IOException
Deletes the specified file from the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.fileName
- The name of the file to delete.recursive
- If the file-path parameter represents a directory instead of a file, you can set the recursive parameter to true to delete the directory and all of the files and subdirectories in it. If recursive is false or null, then the directory must be empty or deletion will fail.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteFileFromTask
public void deleteFileFromTask(String jobId, String taskId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Deletes the specified file from the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.fileName
- The name of the file to delete.recursive
- If the file-path parameter represents a directory instead of a file, you can set the recursive parameter to true to delete the directory and all of the files and subdirectories in it. If recursive is false or null, then the directory must be empty or deletion will fail.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteFileFromComputeNode
public void deleteFileFromComputeNode(String poolId, String nodeId, String fileName) throws BatchErrorException, IOException
Deletes the specified file from the specified compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- The ID of the compute node.fileName
- The name of the file to delete.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteFileFromComputeNode
public void deleteFileFromComputeNode(String poolId, String nodeId, String fileName, Boolean recursive) throws BatchErrorException, IOException
Deletes the specified file from the specified compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- The ID of the compute node.fileName
- The name of the file to delete.recursive
- If the file-path parameter represents a directory instead of a file, you can set the recursive parameter to true to delete the directory and all of the files and subdirectories in it. If recursive is false or null, then the directory must be empty or deletion will fail.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
deleteFileFromComputeNode
public void deleteFileFromComputeNode(String poolId, String nodeId, String fileName, Boolean recursive, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Deletes the specified file from the specified compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- The ID of the compute node.fileName
- The name of the file to delete.recursive
- If the file-path parameter represents a directory instead of a file, you can set the recursive parameter to true to delete the directory and all of the files and subdirectories in it. If recursive is false or null, then the directory must be empty or deletion will fail.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getFileFromTask
public void getFileFromTask(String jobId, String taskId, String fileName, OutputStream outputStream) throws BatchErrorException, IOException
Downloads the specified file from the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.fileName
- The name of the file to download.outputStream
- A stream into which the file contents will be written.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getFileFromTask
public void getFileFromTask(String jobId, String taskId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors, OutputStream outputStream) throws BatchErrorException, IOException
Downloads the specified file from the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.fileName
- The name of the file to download.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.outputStream
- A stream into which the file contents will be written.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getFileFromComputeNode
public void getFileFromComputeNode(String poolId, String nodeId, String fileName, OutputStream outputStream) throws BatchErrorException, IOException
Downloads the specified file from the specified compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- The ID of the compute node.fileName
- The name of the file to download.outputStream
- A stream into which the file contents will be written.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getFileFromComputeNode
public void getFileFromComputeNode(String poolId, String nodeId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors, OutputStream outputStream) throws BatchErrorException, IOException
Downloads the specified file from the specified compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- The ID of the compute node.fileName
- The name of the file to download.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.outputStream
- A stream into which the file contents will be written.- Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getFilePropertiesFromTask
public FileProperties getFilePropertiesFromTask(String jobId, String taskId, String fileName) throws BatchErrorException, IOException
Gets information about a file from the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.fileName
- The name of the file to retrieve.- Returns:
- A
FileProperties
instance containing information about the file. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getFilePropertiesFromTask
public FileProperties getFilePropertiesFromTask(String jobId, String taskId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Gets information about a file from the specified task's directory on its compute node.- Parameters:
jobId
- The ID of the job containing the task.taskId
- The ID of the task.fileName
- The name of the file to retrieve.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- A
FileProperties
instance containing information about the file. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getFilePropertiesFromComputeNode
public FileProperties getFilePropertiesFromComputeNode(String poolId, String nodeId, String fileName) throws BatchErrorException, IOException
Gets information about a file on a compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- the ID of the compute node.fileName
- The name of the file to retrieve.- Returns:
- A
FileProperties
instance containing information about the file. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
getFilePropertiesFromComputeNode
public FileProperties getFilePropertiesFromComputeNode(String poolId, String nodeId, String fileName, Iterable<BatchClientBehavior> additionalBehaviors) throws BatchErrorException, IOException
Gets information about a file on a compute node.- Parameters:
poolId
- The ID of the pool that contains the compute node.nodeId
- the ID of the compute node.fileName
- The name of the file to retrieve.additionalBehaviors
- A collection ofBatchClientBehavior
instances that are applied to the Batch service request.- Returns:
- A
FileProperties
instance containing information about the file. - Throws:
BatchErrorException
- Exception thrown when an error response is received from the Batch service.IOException
- Exception thrown when there is an error in serialization/deserialization of data sent to/received from the Batch service.
-
-