|
||||||||||
| 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(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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static CmisObject getObject(String pathOrIdOfObject,
Session session)
pathOrIdOfObject - the path or object idsession - the session
CmisBaseException
public static Folder getFolder(String pathOrIdOfObject,
Session session)
pathOrIdOfObject - the path or folder idsession - the session
CmisBaseException
public 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
CmisBaseException
public 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 nullsession - the session
public static Folder createFolder(Folder parentFolder,
String name,
String type)
parentFolder - the parent foldername - the folder nametype - the folder type (defaults to cmis:folder)
CmisBaseException
public 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 session
CmisBaseException
public static void download(Document doc,
String destinationPath)
throws IOException
doc - the documentdestinationPath - the destination path
IOException
CmisBaseException
public static void download(String docIdOrPath,
String destinationPath,
Session session)
throws IOException
docIdOrPath - the id or path of the documentdestinationPath - the destination pathsession - the session
IOException
CmisBaseException
public static void delete(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,
PrintStream out)
object - the objectpublic static void printProperty(Property<?> prop)
public static void printProperty(Property<?> prop,
PrintStream out)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||