Class TempRemoteFile
- java.lang.Object
-
- org.syncany.plugins.transfer.files.RemoteFile
-
- org.syncany.plugins.transfer.files.TempRemoteFile
-
public class TempRemoteFile extends RemoteFile
The temp file represents a temporary file on the remote storage.Name pattern: The name pattern of a temp file is temp-<randomidentifier>.
-
-
Constructor Summary
Constructors Constructor Description TempRemoteFile(java.lang.String name)
Initializes a new temp file, given a name.TempRemoteFile(RemoteFile targetRemoteFile)
Initializes a new randomly named temp file.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RemoteFile
getTargetRemoteFile()
Returns the target remote file, i.e.protected 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
-
TempRemoteFile
public TempRemoteFile(java.lang.String name) throws StorageException
Initializes a new temp file, given a name.- Parameters:
name
- temp file name; must always match theNAME_PATTERN
- Throws:
StorageException
- If the name is not match the name pattern
-
TempRemoteFile
public TempRemoteFile(RemoteFile targetRemoteFile) throws StorageException
Initializes a new randomly named temp file.- Throws:
StorageException
-
-
Method Detail
-
getTargetRemoteFile
public RemoteFile getTargetRemoteFile()
Returns the target remote file, i.e. theRemoteFile
this temporary file will be renamed into, or was renamed from.
-
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.
-
-