public class PublicObjectUtilities extends Object
Modifier and Type | Field and Description |
---|---|
protected LibrarySession |
m_session
the session
|
Constructor and Description |
---|
PublicObjectUtilities(LibrarySession session)
Creates a ContentResolver
|
Modifier and Type | Method and Description |
---|---|
PublicObject |
copyPublicObject(Folder dest,
PublicObject po,
String newName)
Performs a copy and rename of an Item.
|
PublicObject |
copyPublicObjectWithVersioning(Folder dest,
PublicObject po,
String newName)
Performs a copy and rename of an Item following the veriosning semantics
will follow verioning semantics in Folder dest
|
Document |
createDocument(Folder parent,
InputStream in,
String name,
AccessControlList acl,
boolean takeAclFromParent)
encapsulates plain non-versioned document creation given a parent folder,
a name, and an inputstream;
will not update a prior existing object in parent,
will throw an IfsException simply because an object already exists
in parent with name
|
Document |
createDocument(Folder parent,
InputStream in,
String name,
String classname,
AccessControlList acl,
boolean takeAclFromParent)
encapsulates plain non-versioned document creation given a parent folder,
a name, and an inputstream;
will not update a prior existing object in parent,
will throw an IfsException simply because an object already exists
in parent with name
|
Family |
createFamily(Folder parent,
InputStream in,
String name,
AccessControlList acl,
boolean takeAclFromParent)
Creates a Family with an initial doc.
|
Folder |
createFolder(Folder parent,
String name,
AccessControlList acl)
Creates a default folder
|
Folder |
createFolder(Folder parent,
String name,
AccessControlList acl,
boolean takeAclFromParent)
Creates a default folder
|
Folder |
createFolderPath(String path,
AccessControlList acl)
Creates all folders in a path where the path contains at least one
folder to be created.
|
Folder |
createFolderPath(String path,
AccessControlList acl,
boolean takeAclFromParent)
Creates all folders in a path where the path contains at least one
folder to be created.
|
protected DocumentDefinition |
getDocDef(Folder parent,
InputStream in,
String name,
AccessControlList acl,
boolean takeAclFromParent)
defines what it means to be a plain non versioned doc
|
protected FolderDefinition |
getFolderDef(Folder parent,
String name,
AccessControlList acl,
boolean takeAclFromParent)
defines what it means to be a plain non versioned doc
|
protected VersionDescriptionDefinition |
getVersionDef(Folder parent,
InputStream in,
String name,
AccessControlList acl,
boolean takeAclFromParent)
defines what it means to be a Family with an initial doc defined in in
|
void |
movePublicObject(Folder src,
Folder dest,
PublicObject po,
String newName)
Performs a move and rename of an Item,
if the src and dest are the same just a rename is performed,
newName can be the same as the po.getName()
|
void |
movePublicObjectWithFormatUpdate(Folder src,
Folder dest,
PublicObject po,
String newName)
Performs a move and rename of an Item,
if the src and dest are the same just a rename is performed,
newName can be the same as the po.getName().
|
void |
movePublicObjectWithVersioning(Folder src,
Folder dest,
PublicObject po,
String newName)
Performs a move and rename of an Item,
if the src and dest are the same just a rename is performed,
newName can be the same as the po.getName()
will follow verioning semantics in Folder dest
|
PublicObject |
putAsDocumentWithVersioning(Folder parent,
InputStream in,
String name,
AccessControlList acl,
boolean takeAclFromParent)
encapsulates the ftpish notion of a put given a parent folder, a name,
and an inputstream; will create or update existing PO depending prior
existence of an object in parent, if creating a plain non-versioned
Document is created will not IfsException simply because an object
does or doesn't exist at the path, but will throw if folders in path
do not exist; may throw if world changes in terms of items in the
folder during call
|
PublicObject |
putAsFamilyWithVersioning(Folder parent,
InputStream in,
String name,
AccessControlList acl,
boolean takeAclFromParent)
encapsulates the ftpish notion of a put given a parent folder, a name,
and an inputstream;
will create or update depending prior existence of an object in parent,
if creating a Family with an inital version of a document whose content
is the inputstream is created
will not IfsException simply because an object does or doesn't exist
at the path, but will throw if folders in path do not exist;
may throw if world changes in terms of items in the folder during call
|
PublicObject |
putPublicObjectWithVersioning(Folder parent,
InputStream in,
String name,
String classname,
AccessControlList acl,
boolean takeAclFromParent)
encapsulates the ftpish notion of a put given a parent folder,
a name, and an inputstream;
will create or update existing PO depending prior existence of
an object in parent, if creating an object of class classname is created.
|
AccessControlList |
resolveAcl(AccessControlList overriddingAcl,
boolean fromParent,
Folder parent)
Resolves the acl to use based on an overridding acl, parent, and a boolean.
|
static LibraryObjectDefinition |
setAcl(LibraryObjectDefinition def,
AccessControlList acl,
Folder parent,
boolean takeAclFromParent)
defines how to set an acl based on a absolute acl, a boolean, and a parent folder
|
Document |
updateFolderedPublicObjectWithVersioning(Folder parent,
InputStream in,
String name,
AccessControlList acl,
boolean takeAclFromParent)
encapsulates the item update given a parent folder, a name, and an
inputstream;
will update a prior existing object in parent,
will throw an IfsException simply because an object doesn't exist in parent
|
PublicObject |
updateFolderedPublicObjectWithVersioning(Folder parent,
PublicObject currentObject,
PublicObject newObject)
performs update of an existing object using iFS versioning.
|
Family |
versionPublicObject(Folder parent,
PublicObject po)
This method creates a family with an initial po.
|
protected LibrarySession m_session
public PublicObjectUtilities(LibrarySession session)
public PublicObject putPublicObjectWithVersioning(Folder parent, InputStream in, String name, String classname, AccessControlList acl, boolean takeAclFromParent) throws IOException, IfsException
parent
- the folder where the item goesin
- the content streamname
- the name of the itemclassname
- the classname of the new object, must be
Document.CLASS_NAME or a subclass of Documentacl
- the acl to be set on the object when method returns;
can be nulltakeAclFromParent
- only checked if acl == nullIOException
IfsException
public PublicObject putAsDocumentWithVersioning(Folder parent, InputStream in, String name, AccessControlList acl, boolean takeAclFromParent) throws IOException, IfsException
parent
- the folder where the item goesin
- the content streamname
- the name of the itemacl
- the ACL to be set on the object when method returns; can be nulltakeAclFromParent
- only checked if acl == nullIOException
IfsException
public PublicObject putAsFamilyWithVersioning(Folder parent, InputStream in, String name, AccessControlList acl, boolean takeAclFromParent) throws IOException, IfsException
parent
- the folder where the item goesin
- the content streamname
- the name of the itemacl
- the ACL to be set on the object when method returns;
can be nulltakeAclFromParent
- only checked if acl == nullIOException
IfsException
public PublicObject updateFolderedPublicObjectWithVersioning(Folder parent, PublicObject currentObject, PublicObject newObject) throws IfsException
IfsException
public Document updateFolderedPublicObjectWithVersioning(Folder parent, InputStream in, String name, AccessControlList acl, boolean takeAclFromParent) throws IfsException, IOException
parent
- the folder where the item goesin
- the content streamname
- the name of the itemacl
- the ACL to be set on the object when method returns; can be nulltakeAclFromParent
- only checked if acl == nullIfsException
IOException
public Family createFamily(Folder parent, InputStream in, String name, AccessControlList acl, boolean takeAclFromParent) throws IfsException
parent
- the folder in which to place the familyin
- the initial doc's contentacl
- the overidding acltakeAclFromParent
- if acl == null and true acl of family
will be set to the acl of the parentIfsException
public Family versionPublicObject(Folder parent, PublicObject po) throws IfsException
parent
- the parent of the po. can't be nullpo
- the publicobject to be famlied.IfsException
public Document createDocument(Folder parent, InputStream in, String name, AccessControlList acl, boolean takeAclFromParent) throws IfsException, IOException
parent
- the folder where the item goesin
- the content streamname
- the name of the documentacl
- the ACL to be set on the document when method returns;
can be nulltakeAclFromParent
- only checked if acl == nullIfsException
IOException
public Document createDocument(Folder parent, InputStream in, String name, String classname, AccessControlList acl, boolean takeAclFromParent) throws IfsException, IOException
parent
- the folder where the item goesin
- the content streamname
- the name of the documentclassname
- the classname of the new object, must be
Document.CLASS_NAME or a subclass of Documentacl
- the ACL to be set on the document when method returns;
can be nulltakeAclFromParent
- only checked if acl == nullIfsException
IOException
public Folder createFolderPath(String path, AccessControlList acl) throws IfsException
path
- The pathIfsException
public Folder createFolderPath(String path, AccessControlList acl, boolean takeAclFromParent) throws IfsException
path
- The pathIfsException
public Folder createFolder(Folder parent, String name, AccessControlList acl) throws IfsException
parent
- the folder where this folder should be created;
if null an unfoldered Folder is createdname
- the name of the new folderacl
- the acl to be set; can be nullIfsException
public Folder createFolder(Folder parent, String name, AccessControlList acl, boolean takeAclFromParent) throws IfsException
parent
- the folder where this folder should be created; if null
an unfoldered Folder is createdname
- the name of the new folderacl
- the acl to be set; can be nulltakeAclFromParent
- wether to take acl from parent; only checked
if acl is nullIfsException
public void movePublicObjectWithVersioning(Folder src, Folder dest, PublicObject po, String newName) throws IfsException
IfsException
public void movePublicObject(Folder src, Folder dest, PublicObject po, String newName) throws IfsException
IfsException
public void movePublicObjectWithFormatUpdate(Folder src, Folder dest, PublicObject po, String newName) throws IfsException
IfsException
public PublicObject copyPublicObjectWithVersioning(Folder dest, PublicObject po, String newName) throws IfsException
dest
- the FOLDER for the copy to be foldered inpo
- the PublicObject to be copiednewName
- the name to be set on the copyif
- the operation failsIfsException
public PublicObject copyPublicObject(Folder dest, PublicObject po, String newName) throws IfsException
dest
- the FOLDER for the copy to be foldered inpo
- the PublicObject to be copiednewName
- the name to be set on the copyif
- the operation failsIfsException
public AccessControlList resolveAcl(AccessControlList overriddingAcl, boolean fromParent, Folder parent) throws IfsException
overriddingAcl
- if not null this will be returnedfromParent
- whether to take the acl from the parent if overridding acl is nullparent
- the parent FolderIfsException
protected VersionDescriptionDefinition getVersionDef(Folder parent, InputStream in, String name, AccessControlList acl, boolean takeAclFromParent) throws IfsException
IfsException
protected DocumentDefinition getDocDef(Folder parent, InputStream in, String name, AccessControlList acl, boolean takeAclFromParent) throws IfsException
IfsException
protected FolderDefinition getFolderDef(Folder parent, String name, AccessControlList acl, boolean takeAclFromParent) throws IfsException
IfsException
public static LibraryObjectDefinition setAcl(LibraryObjectDefinition def, AccessControlList acl, Folder parent, boolean takeAclFromParent) throws IfsException
acl
- the ACL to be set on the object when method returns; can be nulltakeAclFromParent
- only checked if acl == nullparent
- the folder where acl should be taken from if ((acl == null) && (takeAclFromParent))IfsException
Copyright © 2023. All rights reserved.