Package dk.netarkivet.common.distribute
Class RemoteFileFactory
- java.lang.Object
-
- dk.netarkivet.common.utils.SettingsFactory<RemoteFile>
-
- dk.netarkivet.common.distribute.RemoteFileFactory
-
public class RemoteFileFactory extends SettingsFactory<RemoteFile>
Factory for creating remote files.
-
-
Constructor Summary
Constructors Constructor Description RemoteFileFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static RemoteFile
getCopyfileInstance(File file)
Same as getInstance(file, false, false, false, null).static RemoteFile
getCopyfileInstance(File file, RemoteFileSettings connectionParams)
Same as getInstance(file, false, false, false, connectionParams).static RemoteFile
getDistributefileInstance(File file)
Same as getInstance(file, false, false, false).static RemoteFile
getExtendedInstance(org.archive.io.ArchiveRecord record)
Get an instance connected to an ArchiveRecord.static RemoteFile
getInstance(File file, boolean useChecksums, boolean fileDeletable, boolean multipleDownloads)
static RemoteFile
getInstance(File file, boolean useChecksums, boolean fileDeletable, boolean multipleDownloads, RemoteFileSettings connectionParams)
Create a remote file that handles the transport of the remote file data.static RemoteFile
getMovefileInstance(File file)
Same as getInstance(file, false, true, false).static boolean
isExtendedRemoteFile()
Returns true iff the defined RemoteFile class has a factory method with signature public static RemoteFile getInstance(ArchiveRecord record)-
Methods inherited from class dk.netarkivet.common.utils.SettingsFactory
getInstance
-
-
-
-
Method Detail
-
getInstance
public static RemoteFile getInstance(File file, boolean useChecksums, boolean fileDeletable, boolean multipleDownloads, RemoteFileSettings connectionParams)
Create a remote file that handles the transport of the remote file data. This method is used by the sender to prepare the transport over JMS.- Parameters:
file
- The File object to make accessable on another machineuseChecksums
- Whether transfers should be doublechecked with checksums. Added value is access to checksum of objects.fileDeletable
- If true, the local file will be deleted when it is no longer needed.multipleDownloads
- Whether this file should be allowed to be transferred more than once.- Returns:
- A RemoteFile instance encapsulating the file argument.
-
getInstance
public static RemoteFile getInstance(File file, boolean useChecksums, boolean fileDeletable, boolean multipleDownloads)
-
getExtendedInstance
public static RemoteFile getExtendedInstance(org.archive.io.ArchiveRecord record)
Get an instance connected to an ArchiveRecord. Records are not deletable so there is no concept of a "movefile" instance.- Parameters:
record
-- Returns:
- the file to be copied.
-
isExtendedRemoteFile
public static boolean isExtendedRemoteFile()
Returns true iff the defined RemoteFile class has a factory method with signature public static RemoteFile getInstance(ArchiveRecord record)- Returns:
- true if using an extended remote file.
-
getMovefileInstance
public static RemoteFile getMovefileInstance(File file)
Same as getInstance(file, false, true, false).- Parameters:
file
- The file to move to another computer.
-
getCopyfileInstance
public static RemoteFile getCopyfileInstance(File file)
Same as getInstance(file, false, false, false, null).- Parameters:
file
- The file to copy to another computer.
-
getCopyfileInstance
public static RemoteFile getCopyfileInstance(File file, RemoteFileSettings connectionParams)
Same as getInstance(file, false, false, false, connectionParams).- Parameters:
file
- The file to copy to another computer.
-
getDistributefileInstance
public static RemoteFile getDistributefileInstance(File file)
Same as getInstance(file, false, false, false).- Parameters:
file
- The file to copy to another computer.
-
-