Package dk.netarkivet.common.distribute
Interface RemoteFile
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractRemoteFile
,ExtendedFTPRemoteFile
,FileRemoteFile
,FTPRemoteFile
,HTTPRemoteFile
,HTTPSRemoteFile
,NullRemoteFile
,StringRemoteFile
,TestRemoteFile
public interface RemoteFile extends Serializable
RemoteFile: Interface for encapsulating remote files. Enables us to transmit large files between system components situated on different machines. Our current JMS broker(s) does not allow large message (i.e. messages > 70 MB).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
appendTo(OutputStream out)
Write the contents of this remote file to an output stream.void
cleanup()
Cleanup this remote file.void
copyTo(File destFile)
Copy remotefile to local disk storage.String
getChecksum()
Returns a MD5 Checksum on the file.InputStream
getInputStream()
Get an inputstream that contains the data transferred in this RemoteFile.String
getName()
Return the file name.long
getSize()
Returns the total size of the remote file.
-
-
-
Method Detail
-
copyTo
void copyTo(File destFile)
Copy remotefile to local disk storage. Used by the data recipient- Parameters:
destFile
- local File- Throws:
IOFailure
- on communication trouble.ArgumentNotValid
- on null parameter or non-writable file
-
appendTo
void appendTo(OutputStream out)
Write the contents of this remote file to an output stream.- Parameters:
out
- OutputStream that the data will be written to. This stream will not be closed by this operation.- Throws:
IOFailure
- If append operation failsArgumentNotValid
- on null parameter
-
getInputStream
InputStream getInputStream()
Get an inputstream that contains the data transferred in this RemoteFile.- Returns:
- A stream object with the data in the object. Note that the close() method of this may throw exceptions if e.g. a transmission error is detected.
- Throws:
IOFailure
- on communication trouble.
-
getName
String getName()
Return the file name.- Returns:
- the file name
-
getChecksum
String getChecksum()
Returns a MD5 Checksum on the file. May return null, if checksums not supported for this operation.- Returns:
- MD5 checksum
-
cleanup
void cleanup()
Cleanup this remote file. The file is invalid after this.
-
getSize
long getSize()
Returns the total size of the remote file.- Returns:
- Size of the remote file.
-
-