public class IOManagerImpl extends Object implements IOManager
Modifier and Type | Field and Description |
---|---|
protected Map<String,IOResourceAdapter> |
adaptersRegistry |
DOCUMENTS_ADAPTER_NAME
Constructor and Description |
---|
IOManagerImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addAdapter(String name,
IOResourceAdapter adapter)
Adds an adapter with given name and definition.
|
Collection<DocumentRef> |
copyDocumentsAndResources(String repo,
Collection<DocumentRef> sources,
DocumentLocation targetLocation,
Collection<String> ioAdapters)
Copy documents and resources to another location (on a same machine).
|
void |
exportDocumentsAndResources(OutputStream out,
String repo,
Collection<DocumentRef> sources,
boolean recurse,
String format,
Collection<String> ioAdapters)
Export documents and resources.
|
void |
exportDocumentsAndResources(OutputStream out,
String repo,
String format,
Collection<String> ioAdapters,
DocumentReader customDocReader) |
IOResourceAdapter |
getAdapter(String name)
Returns the adapter with given name.
|
void |
importDocumentsAndResources(InputStream in,
String repo,
DocumentRef root)
Import document and resources described by given input stream at given document location.
|
void |
importDocumentsAndResources(InputStream in,
String repo,
DocumentRef root,
DocumentWriter customDocWriter) |
void |
importFromStream(InputStream in,
DocumentLocation targetLocation,
String docReaderFactoryClassName,
Map<String,Object> rFactoryParams,
String docWriterFactoryClassName,
Map<String,Object> wFactoryParams) |
void |
removeAdapter(String name)
Removes adapter with given name.
|
protected final Map<String,IOResourceAdapter> adaptersRegistry
public IOManagerImpl()
public IOResourceAdapter getAdapter(String name)
IOManager
getAdapter
in interface IOManager
public void addAdapter(String name, IOResourceAdapter adapter)
IOManager
addAdapter
in interface IOManager
public void removeAdapter(String name)
IOManager
removeAdapter
in interface IOManager
public void exportDocumentsAndResources(OutputStream out, String repo, String format, Collection<String> ioAdapters, DocumentReader customDocReader) throws IOException
IOException
public void exportDocumentsAndResources(OutputStream out, String repo, Collection<DocumentRef> sources, boolean recurse, String format, Collection<String> ioAdapters) throws IOException
IOManager
exportDocumentsAndResources
in interface IOManager
out
- stream that can be turned into a zip holding a group of file for each additional resources types.repo
- TODOsources
- locations of documents to export.recurse
- recurse into sources childrenformat
- export format. XXX see what format is actually accepted.ioAdapters
- list of adapters to use for additional resources.IOException
public void importDocumentsAndResources(InputStream in, String repo, DocumentRef root) throws IOException
IOManager
importDocumentsAndResources
in interface IOManager
in
- stream representing the documents and resources to import. Can be a zip file of a group of export
files. The service is responsible for unzipping and redirecting import to specific import services.repo
- the repository name.root
- Optional location of document that must be taken as root of the import (can be null).IOException
public void importDocumentsAndResources(InputStream in, String repo, DocumentRef root, DocumentWriter customDocWriter) throws IOException
IOException
public Collection<DocumentRef> copyDocumentsAndResources(String repo, Collection<DocumentRef> sources, DocumentLocation targetLocation, Collection<String> ioAdapters)
IOManager
copyDocumentsAndResources
in interface IOManager
repo
- the initial repository name.sources
- locations of documents to export.targetLocation
- location of the document where copies must be placed.ioAdapters
- list of adapters to use for additional resources.public void importFromStream(InputStream in, DocumentLocation targetLocation, String docReaderFactoryClassName, Map<String,Object> rFactoryParams, String docWriterFactoryClassName, Map<String,Object> wFactoryParams)
importFromStream
in interface IOManager
Copyright © 2017 Nuxeo. All rights reserved.