public class ImportZipCommand
extends info.magnolia.commands.impl.BaseRepositoryCommand
Modifier and Type | Field and Description |
---|---|
static String |
BACKSLASH_DUMMY |
protected info.magnolia.context.Context |
context |
static String |
DEFAULT_MIME_TYPE |
static String |
ENCODING_PROPERTY |
static String |
STREAM_PROPERTY |
static String |
ZIP_TMP_FILE_PREFIX |
static String |
ZIP_TMP_FILE_SUFFIX |
Constructor and Description |
---|
ImportZipCommand(info.magnolia.i18nsystem.SimpleTranslator translator) |
Modifier and Type | Method and Description |
---|---|
protected UploadReceiver |
createReceiver() |
protected void |
doHandleEntryFromReceiver(javax.jcr.Node folder,
UploadReceiver receiver)
Actually produce an asset or a node based on the entry data aggregated into an
UploadReceiver object. |
boolean |
execute(info.magnolia.context.Context context) |
String |
getEncoding() |
InputStream |
getInputStream() |
protected void |
handleFileEntry(org.apache.commons.compress.archivers.zip.ZipFile zip,
org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) |
void |
setEncoding(String encoding) |
void |
setInputStream(InputStream inputStream) |
getJCRNode, getNode, getPath, getRepository, getUuid, release, setPath, setRepository, setUuid
public static final String STREAM_PROPERTY
public static final String ENCODING_PROPERTY
public static final String ZIP_TMP_FILE_PREFIX
public static final String ZIP_TMP_FILE_SUFFIX
public static final String DEFAULT_MIME_TYPE
public static final String BACKSLASH_DUMMY
protected info.magnolia.context.Context context
@Inject public ImportZipCommand(info.magnolia.i18nsystem.SimpleTranslator translator)
public boolean execute(info.magnolia.context.Context context) throws Exception
execute
in class info.magnolia.commands.MgnlCommand
Exception
protected void handleFileEntry(org.apache.commons.compress.archivers.zip.ZipFile zip, org.apache.commons.compress.archivers.zip.ZipArchiveEntry entry) throws IOException, javax.jcr.RepositoryException
IOException
javax.jcr.RepositoryException
protected UploadReceiver createReceiver()
protected void doHandleEntryFromReceiver(javax.jcr.Node folder, UploadReceiver receiver) throws javax.jcr.RepositoryException
UploadReceiver
object.folder
- parent folder node for a new entry.receiver
- wraps the entry file and its basic meta-information.javax.jcr.RepositoryException
public InputStream getInputStream()
public void setInputStream(InputStream inputStream)
public String getEncoding()
public void setEncoding(String encoding)
Copyright © 2016 Magnolia International Ltd.. All rights reserved.