|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.chemistry.opencmis.client.util.FileUtils
public class FileUtils
A set of utility methods that simplify file and folder operations.
| Method Summary | |
|---|---|
static Document |
createDocumentFromFile(java.lang.String parentIdOrPath,
java.io.File file,
java.lang.String type,
VersioningState versioningState,
Session session)
Creates a document from a file. |
static Folder |
createFolder(Folder parentFolder,
java.lang.String name,
java.lang.String type)
Creates a child folder with the name specified of the type specified. |
static Folder |
createFolder(java.lang.String parentIdOrPath,
java.lang.String name,
java.lang.String type,
Session session)
Creates a folder using a String identifier. |
static Document |
createTextDocument(java.lang.String parentIdOrPath,
java.lang.String name,
java.lang.String content,
java.lang.String type,
VersioningState versioningState,
Session session)
Creates a text document from a string. |
static void |
delete(java.lang.String pathOrIdOfObject,
Session session)
Deletes an object by path or id (string identifier). |
static void |
download(Document doc,
java.lang.String destinationPath)
Downloads the contentStream for the given doc to the specified path. |
static void |
download(java.lang.String docIdOrPath,
java.lang.String destinationPath,
Session session)
Downloads a document by its id or path. |
static Folder |
getFolder(java.lang.String pathOrIdOfObject,
Session session)
Gets a folder by path or object id. |
static CmisObject |
getObject(java.lang.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,
java.io.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,
java.io.PrintStream out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static CmisObject getObject(java.lang.String pathOrIdOfObject,
Session session)
pathOrIdOfObject - the path or object idsession - the session
CmisBaseException
public static Folder getFolder(java.lang.String pathOrIdOfObject,
Session session)
pathOrIdOfObject - the path or folder idsession - the session
CmisBaseException
public static Document createDocumentFromFile(java.lang.String parentIdOrPath,
java.io.File file,
java.lang.String type,
VersioningState versioningState,
Session session)
throws java.io.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
java.io.FileNotFoundException
CmisBaseException
public static Document createTextDocument(java.lang.String parentIdOrPath,
java.lang.String name,
java.lang.String content,
java.lang.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 nullsession - the session
public static Folder createFolder(Folder parentFolder,
java.lang.String name,
java.lang.String type)
parentFolder - the parent foldername - the folder nametype - the folder type (defaults to cmis:folder)
CmisBaseException
public static Folder createFolder(java.lang.String parentIdOrPath,
java.lang.String name,
java.lang.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 session
CmisBaseException
public static void download(Document doc,
java.lang.String destinationPath)
throws java.io.IOException
doc - the documentdestinationPath - the destination path
java.io.IOException
CmisBaseException
public static void download(java.lang.String docIdOrPath,
java.lang.String destinationPath,
Session session)
throws java.io.IOException
docIdOrPath - the id or path of the documentdestinationPath - the destination pathsession - the session
java.io.IOException
CmisBaseException
public static void delete(java.lang.String pathOrIdOfObject,
Session session)
pathOrIdOfObject - the id or path of the objectsession - the session
CmisBaseExceptionpublic static void printProperties(CmisObject object)
object - the object
public static void printProperties(CmisObject object,
java.io.PrintStream out)
object - the objectpublic static void printProperty(Property<?> prop)
public static void printProperty(Property<?> prop,
java.io.PrintStream out)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||