Class MultichunkRemoteFile
- java.lang.Object
-
- org.syncany.plugins.transfer.files.RemoteFile
-
- org.syncany.plugins.transfer.files.MultichunkRemoteFile
-
public class MultichunkRemoteFile extends RemoteFile
The multichunk file represents a multichunk on the remote storage.Name pattern: The name pattern of a multichunk file is multichunk-<multichunkid>. Initializing an instance with a non-matching name will throw an exception.
-
-
Constructor Summary
Constructors Constructor Description MultichunkRemoteFile(java.lang.String name)
Initializes a new multichunk file, given a name.MultichunkRemoteFile(MultiChunkEntry.MultiChunkId multiChunkId)
Initializes a new multichunk file, given a multichunk identifier
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getMultiChunkId()
Returns the multichunk identifierprotected java.lang.String
validateName(java.lang.String name)
Parses the name of the file and validates it against the classes name pattern.-
Methods inherited from class org.syncany.plugins.transfer.files.RemoteFile
createRemoteFile, createRemoteFile, equals, getAttributes, getName, hashCode, setAttributes, toString
-
-
-
-
Constructor Detail
-
MultichunkRemoteFile
public MultichunkRemoteFile(java.lang.String name) throws StorageException
Initializes a new multichunk file, given a name. This constructor might be called by thecreateRemoteFile()
method of theRemoteFile
.If the pattern matches, the multichunk identifier is set and can be queried by
getMultiChunkId()
.- Parameters:
name
- Multichunk file name; must always match theNAME_PATTERN
- Throws:
StorageException
- If the name is not match the name pattern
-
MultichunkRemoteFile
public MultichunkRemoteFile(MultiChunkEntry.MultiChunkId multiChunkId) throws StorageException
Initializes a new multichunk file, given a multichunk identifier- Parameters:
multiChunkId
- The identifier of the multichunk- Throws:
StorageException
- Never throws an exception
-
-
Method Detail
-
getMultiChunkId
public byte[] getMultiChunkId()
Returns the multichunk identifier
-
validateName
protected java.lang.String validateName(java.lang.String name) throws StorageException
Description copied from class:RemoteFile
Parses the name of the file and validates it against the classes name pattern. WhileRemoteFile
has no name pattern (and never throws an exception), sub-classes might by overriding this method.- Overrides:
validateName
in classRemoteFile
- Parameters:
name
- The name of the file (as it is identified by Syncany)- Returns:
- Returns a (potentially changed) name, after validating the name
- Throws:
StorageException
- If the name does not match the name pattern defined by the class.
Note:RemoteFile
does never throw this exceptions, however, subclasses might.
-
-