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 sessionCmisBaseExceptionpublic static Folder getFolder(String pathOrIdOfObject, Session session)
pathOrIdOfObject - the path or folder idsession - the sessionCmisBaseExceptionpublic 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 nullFileNotFoundExceptionCmisBaseExceptionpublic 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 sessionpublic static Folder createFolder(Folder parentFolder, String name, String type)
parentFolder - the parent foldername - the folder nametype - the folder type (defaults to cmis:folder)CmisBaseExceptionpublic 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 sessionCmisBaseExceptionpublic static void download(Document doc, String destinationPath) throws IOException
doc - the documentdestinationPath - the destination pathIOExceptionCmisBaseExceptionpublic static void download(String docIdOrPath, String destinationPath, Session session) throws IOException
docIdOrPath - the id or path of the documentdestinationPath - the destination pathsession - the sessionIOExceptionCmisBaseExceptionpublic static void delete(String pathOrIdOfObject, Session session)
pathOrIdOfObject - the id or path of the objectsession - the sessionCmisBaseExceptionpublic 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-2014 The Apache Software Foundation. All Rights Reserved.