public final class FileUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Document |
createDocumentFromFile(String parentIdOrPath,
File file,
String type,
VersioningState versioningState,
Session session)
Creates a document from a file.
|
static Folder |
createFolder(Folder parentFolder,
String name,
String type)
Creates a child folder with the name specified of the type specified.
|
static Folder |
createFolder(String parentIdOrPath,
String name,
String type,
Session session)
Creates a folder using a String identifier.
|
static Document |
createTextDocument(String parentIdOrPath,
String name,
String content,
String type,
VersioningState versioningState,
Session session)
Creates a text document from a string.
|
static void |
delete(String pathOrIdOfObject,
Session session)
Deletes an object by path or id (string identifier).
|
static void |
download(Document doc,
String destinationPath)
Downloads the contentStream for the given doc to the specified path.
|
static void |
download(String docIdOrPath,
String destinationPath,
Session session)
Downloads a document by its id or path.
|
static Folder |
getFolder(String pathOrIdOfObject,
Session session)
Gets a folder by path or object id.
|
static CmisObject |
getObject(String pathOrIdOfObject,
Session session)
Gets an object by path or object id.
|
static void |
printProperties(CmisObject object)
Prints out all of the properties for this object to System.out.
|
static void |
printProperties(CmisObject object,
PrintStream out)
Prints out all of the properties for this object to the given
PrintStream.
|
static void |
printProperty(Property<?> prop) |
static void |
printProperty(Property<?> prop,
PrintStream out) |
public static CmisObject getObject(String pathOrIdOfObject, Session session)
pathOrIdOfObject
- the path or object idsession
- the sessionCmisBaseException
- if something go wrong, for example the object doesn't existpublic static Folder getFolder(String pathOrIdOfObject, Session session)
pathOrIdOfObject
- the path or folder idsession
- the sessionCmisBaseException
- if something go wrong, for example the object doesn't existpublic static Document createDocumentFromFile(String parentIdOrPath, File file, String type, VersioningState versioningState, Session session) throws FileNotFoundException
parentIdOrPath
- the id or path of the parent folderfile
- the source filetype
- the document type (defaults to cmis:document
)versioningState
- the versioning state or null
FileNotFoundException
- if the file does not existCmisBaseException
- if something go wrong, for example the object doesn't existpublic static Document createTextDocument(String parentIdOrPath, String name, String content, String type, VersioningState versioningState, Session session)
parentIdOrPath
- the id or path of the parent foldername
- the document namecontent
- the content stringtype
- the document type (defaults to cmis:document
)versioningState
- the versioning state or null
session
- the sessionpublic static Folder createFolder(Folder parentFolder, String name, String type)
parentFolder
- the parent foldername
- the folder nametype
- the folder type (defaults to cmis:folder
)CmisBaseException
- if something go wrong, for example the parent folder doesn't
existpublic static Folder createFolder(String parentIdOrPath, String name, String type, Session session)
parentIdOrPath
- the id or path of the parent foldername
- the folder nametype
- the folder type (defaults to cmis:folder
)session
- the sessionCmisBaseException
- if something go wrong, for example the parent folder doesn't
existpublic static void download(Document doc, String destinationPath) throws IOException
doc
- the documentdestinationPath
- the destination pathIOException
- if the download fails because of an IO problemCmisBaseException
- if something go wrong, for example the document doesn't existpublic static void download(String docIdOrPath, String destinationPath, Session session) throws IOException
docIdOrPath
- the id or path of the documentdestinationPath
- the destination pathsession
- the sessionIOException
- if the download fails because of an IO problemCmisBaseException
- if something go wrong, for example the document doesn't existpublic static void delete(String pathOrIdOfObject, Session session)
pathOrIdOfObject
- the id or path of the objectsession
- the sessionCmisBaseException
- if something go wrong, for example the object doesn't existpublic static void printProperties(CmisObject object)
object
- the objectpublic static void printProperties(CmisObject object, PrintStream out)
object
- the objectpublic static void printProperty(Property<?> prop)
public static void printProperty(Property<?> prop, PrintStream out)
Copyright © 2009–2017 The Apache Software Foundation. All rights reserved.