public abstract class Importer extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
protected static class |
Importer.DefaultNameTransformer
The Class DefaultNameTransformer.
|
protected static class |
Importer.GitNameTransformer
The Class GitNameTransformer.
|
protected class |
Importer.ImportVCard
Wrapper class for VCard datamodel,
adding equals and hashCode for better
determination in HashMaps/-Sets
|
Modifier and Type | Field and Description |
---|---|
static String |
IMPORT_GIT |
static String |
IMPORT_HTTP |
protected String |
remoteUrl |
protected File |
tempFile |
protected UserManager |
user |
Constructor and Description |
---|
Importer(UserManager user) |
Modifier and Type | Method and Description |
---|---|
abstract void |
close() |
protected File |
createTempDir()
creates a temporary directory, should be cleaned in close.
|
static Importer |
getImporter(Archive archive,
UserManager user)
Gets an importer corresponding to the type of archive.
|
static Importer |
getImporter(String type,
String remoteUrl,
UserManager user)
Gets an importer corresponding to the given type.
|
String |
getRemoteUrl() |
String |
getSuggestedName()
Suggest a name, in case the user does not provide one
|
File |
getTempFile() |
abstract Importer |
importRepo() |
static boolean |
isImportable(Archive archive)
Checks if the given archive contains import information.
|
public static final String IMPORT_HTTP
public static final String IMPORT_GIT
protected String remoteUrl
protected File tempFile
protected UserManager user
public Importer(UserManager user)
public static Importer getImporter(Archive archive, UserManager user) throws ImporterException
archive
- the archiveuser
- the userImporterException
- the importer exceptionpublic static Importer getImporter(String type, String remoteUrl, UserManager user) throws ImporterException
type
- the typeremoteUrl
- the remote urluser
- the userImporterException
- the importer exceptionpublic static boolean isImportable(Archive archive)
archive
- the archivepublic File getTempFile()
public String getRemoteUrl()
public abstract Importer importRepo() throws ImporterException
ImporterException
public abstract void close()
close
in interface Closeable
close
in interface AutoCloseable
public String getSuggestedName()
protected File createTempDir() throws ImporterException
ImporterException
- the importer exceptionCopyright © 2018 SEMS project @ University of Rostock. All rights reserved.