Class Archive
- java.lang.Object
-
- de.unirostock.sems.cbarchive.web.dataholder.Archive
-
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
ArchiveFromExisting,ArchiveFromGit,ArchiveFromHttp
public class Archive extends Object implements Closeable
Dataholder/Model class for CombineArchives- Author:
- Martin Peters
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArchive.ReplaceStrategy
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,ArchiveEntryDataholder>entriesprotected Stringidprotected booleanincludeVCardprotected Locklockprotected List<MetaObjectDataholder>metaprotected Stringnameprotected Stringtemplatestatic StringTEMPLATE_EXISTINGstatic StringTEMPLATE_GITstatic StringTEMPLATE_HGstatic StringTEMPLATE_HTTPstatic StringTEMPLATE_PLAIN
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description de.unirostock.sems.cbarchive.ArchiveEntryaddArchiveEntry(String fileName, Path file)de.unirostock.sems.cbarchive.ArchiveEntryaddArchiveEntry(String fileName, Path file, Archive.ReplaceStrategy strategy)voidclose()longcountArchiveEntries()de.unirostock.sems.cbarchive.CombineArchivegetArchive()FilegetArchiveFile()Map<String,ArchiveEntryDataholder>getEntries()ArchiveEntryDataholdergetEntryById(String id)StringgetId()StringgetName()StringgetTemplate()booleanisIncludeVCard()voidpackAndClose()voidsetArchiveFile(File file, Lock lock)voidsetId(String id)voidsetIncludeVCard(boolean includeVCard)voidsetName(String name)voidsetTemplate(String template)
-
-
-
Field Detail
-
TEMPLATE_PLAIN
public static final String TEMPLATE_PLAIN
- See Also:
- Constant Field Values
-
TEMPLATE_HG
public static final String TEMPLATE_HG
- See Also:
- Constant Field Values
-
TEMPLATE_GIT
public static final String TEMPLATE_GIT
- See Also:
- Constant Field Values
-
TEMPLATE_HTTP
public static final String TEMPLATE_HTTP
- See Also:
- Constant Field Values
-
TEMPLATE_EXISTING
public static final String TEMPLATE_EXISTING
- See Also:
- Constant Field Values
-
template
protected String template
-
includeVCard
protected boolean includeVCard
-
id
protected String id
-
name
protected String name
-
entries
protected Map<String,ArchiveEntryDataholder> entries
-
meta
protected List<MetaObjectDataholder> meta
-
lock
protected Lock lock
-
-
Constructor Detail
-
Archive
public Archive(String id, String name, File file, Lock lock) throws CombineArchiveWebException
- Throws:
CombineArchiveWebException
-
Archive
public Archive()
-
Archive
public Archive(String name)
-
-
Method Detail
-
getId
public String getId()
-
setId
public void setId(String id)
-
getName
public String getName()
-
setName
public void setName(String name)
-
getEntries
public Map<String,ArchiveEntryDataholder> getEntries()
-
getTemplate
public String getTemplate()
-
setTemplate
public void setTemplate(String template)
-
isIncludeVCard
public boolean isIncludeVCard()
-
setIncludeVCard
public void setIncludeVCard(boolean includeVCard)
-
setArchiveFile
public void setArchiveFile(File file, Lock lock) throws CombineArchiveWebException
- Throws:
CombineArchiveWebException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
packAndClose
public void packAndClose() throws IOException, TransformerException- Throws:
IOExceptionTransformerException
-
getArchiveFile
public File getArchiveFile()
-
getArchive
public de.unirostock.sems.cbarchive.CombineArchive getArchive()
-
countArchiveEntries
public long countArchiveEntries()
-
addArchiveEntry
public de.unirostock.sems.cbarchive.ArchiveEntry addArchiveEntry(String fileName, Path file) throws CombineArchiveWebException, IOException
-
getEntryById
public ArchiveEntryDataholder getEntryById(String id)
-
addArchiveEntry
public de.unirostock.sems.cbarchive.ArchiveEntry addArchiveEntry(String fileName, Path file, Archive.ReplaceStrategy strategy) throws CombineArchiveWebException, IOException
-
-