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 class
Archive.ReplaceStrategy
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,ArchiveEntryDataholder>
entries
protected String
id
protected boolean
includeVCard
protected Lock
lock
protected List<MetaObjectDataholder>
meta
protected String
name
protected String
template
static String
TEMPLATE_EXISTING
static String
TEMPLATE_GIT
static String
TEMPLATE_HG
static String
TEMPLATE_HTTP
static String
TEMPLATE_PLAIN
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description de.unirostock.sems.cbarchive.ArchiveEntry
addArchiveEntry(String fileName, Path file)
de.unirostock.sems.cbarchive.ArchiveEntry
addArchiveEntry(String fileName, Path file, Archive.ReplaceStrategy strategy)
void
close()
long
countArchiveEntries()
de.unirostock.sems.cbarchive.CombineArchive
getArchive()
File
getArchiveFile()
Map<String,ArchiveEntryDataholder>
getEntries()
ArchiveEntryDataholder
getEntryById(String id)
String
getId()
String
getName()
String
getTemplate()
boolean
isIncludeVCard()
void
packAndClose()
void
setArchiveFile(File file, Lock lock)
void
setId(String id)
void
setIncludeVCard(boolean includeVCard)
void
setName(String name)
void
setTemplate(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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
packAndClose
public void packAndClose() throws IOException, TransformerException
- Throws:
IOException
TransformerException
-
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
-
-