public abstract class Importer extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
protected static class |
Importer.DefaultNameTransformer |
protected static class |
Importer.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
- user
- ImporterException
public static Importer getImporter(String type, String remoteUrl, UserManager user) throws ImporterException
type
- remoteUrl
- user
- ImporterException
public static boolean isImportable(Archive archive)
archive
- public 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
Copyright © 2015. All Rights Reserved.