Package adams.core.io
Interface ArchiveManager
-
- All Superinterfaces:
Destroyable
,OptionHandler
,QuickInfoSupporter
- All Known Implementing Classes:
TarArchiveManager
,ZipArchiveManager
public interface ArchiveManager extends OptionHandler, QuickInfoSupporter
Interface for archive managers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
add(byte[] data, String name)
Adds the data to the archive.String
add(PlaceholderFile data, String name)
Adds the file to the archive.String
add(InputStream data, String name)
Adds the data from the input stream to the archive.String
close()
Finalizes the archive.String
initialize(PlaceholderFile output)
Initializes the archive.-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, defineOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.core.QuickInfoSupporter
getQuickInfo
-
-
-
-
Method Detail
-
initialize
String initialize(PlaceholderFile output)
Initializes the archive.- Parameters:
output
- the file name for the archive- Returns:
- null if successful, otherwise error message
-
add
String add(PlaceholderFile data, String name)
Adds the file to the archive.- Parameters:
data
- the file to addname
- the name for the file in the archive- Returns:
- null if successful, otherwise error message
-
add
String add(InputStream data, String name)
Adds the data from the input stream to the archive. Caller needs to close input stream.- Parameters:
data
- the data to addname
- the name for the data in the archive- Returns:
- null if successful, otherwise error message
-
add
String add(byte[] data, String name)
Adds the data to the archive.- Parameters:
data
- the data to addname
- the name for the data in the archive- Returns:
- null if successful, otherwise error message
-
close
String close()
Finalizes the archive.- Returns:
- null if successful, otherwise error message
-
-