Package dk.netarkivet.common.distribute
Class NullRemoteFile
- java.lang.Object
-
- dk.netarkivet.common.distribute.NullRemoteFile
-
- All Implemented Interfaces:
RemoteFile
,java.io.Serializable
public class NullRemoteFile extends java.lang.Object implements RemoteFile
This is an implementation of RemoteFile which does nothing and can therefore be used in batch jobs for which no output is required.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NullRemoteFile()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
appendTo(java.io.OutputStream out)
Write the contents of this remote file to an output stream.void
cleanup()
Cleanup this remote file.void
copyTo(java.io.File destFile)
Copy remotefile to local disk storage.java.lang.String
getChecksum()
Returns a MD5 Checksum on the file.java.io.InputStream
getInputStream()
Get an inputstream that contains the data transferred in this RemoteFile.static RemoteFile
getInstance(java.io.File f, java.lang.Boolean useChecksums, java.lang.Boolean fileDeletable, java.lang.Boolean multipleDownloads)
java.lang.String
getName()
Return the file name.long
getSize()
Returns the total size of the remote file.
-
-
-
Constructor Detail
-
NullRemoteFile
public NullRemoteFile()
-
-
Method Detail
-
getInstance
public static RemoteFile getInstance(java.io.File f, java.lang.Boolean useChecksums, java.lang.Boolean fileDeletable, java.lang.Boolean multipleDownloads)
-
copyTo
public void copyTo(java.io.File destFile)
Description copied from interface:RemoteFile
Copy remotefile to local disk storage. Used by the data recipient- Specified by:
copyTo
in interfaceRemoteFile
- Parameters:
destFile
- local File- See Also:
RemoteFile.copyTo(File)
-
appendTo
public void appendTo(java.io.OutputStream out)
Description copied from interface:RemoteFile
Write the contents of this remote file to an output stream.- Specified by:
appendTo
in interfaceRemoteFile
- Parameters:
out
- OutputStream that the data will be written to. This stream will not be closed by this operation.- See Also:
RemoteFile.appendTo(OutputStream)
-
getInputStream
public java.io.InputStream getInputStream()
Description copied from interface:RemoteFile
Get an inputstream that contains the data transferred in this RemoteFile.- Specified by:
getInputStream
in interfaceRemoteFile
- 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.
-
cleanup
public void cleanup()
Description copied from interface:RemoteFile
Cleanup this remote file. The file is invalid after this.- Specified by:
cleanup
in interfaceRemoteFile
- See Also:
RemoteFile.cleanup()
-
getSize
public long getSize()
Description copied from interface:RemoteFile
Returns the total size of the remote file.- Specified by:
getSize
in interfaceRemoteFile
- Returns:
- Size of the remote file.
- See Also:
RemoteFile.getSize()
-
getName
public java.lang.String getName()
Return the file name.- Specified by:
getName
in interfaceRemoteFile
- Returns:
- the file name
- See Also:
RemoteFile.getName()
-
getChecksum
public java.lang.String getChecksum() throws NotImplementedException
Returns a MD5 Checksum on the file.- Specified by:
getChecksum
in interfaceRemoteFile
- Returns:
- MD5 checksum
- Throws:
NotImplementedException
- Because it is not implemented- See Also:
RemoteFile.getChecksum()
-
-