public class ManagedFileDirectoryUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String | COPYRIGHT
IBM Copyright notice field.
|
static java.lang.String | DEFAULT_DIRECTORY_SEPARATOR
This is the directory separator used.
|
static java.lang.Long | DEFAULT_STORE_DIRECTORY_PARENT_ID
This is the store directory's parent id in the CMFILEDIR table.
|
Constructor and Description |
---|
ManagedFileDirectoryUtility(java.sql.Connection connection)
This is the constructor for this class.
|
ManagedFileDirectoryUtility(java.sql.Connection connection, boolean insideCommerceEnvironment)
This is the constructor for this class.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Long | createDirectory(java.lang.String astrStoreDirectory, java.lang.String astrPathName)
This method will first check if the path name astrPathName already exists for the store directory astrStoreDirectory.
|
int | deleteDirectoryRecord(java.lang.Long aDirId)
This method deletes one directory record in the CMFILEDIR table.
|
java.util.ArrayList | getAllSubDirectoryIds(java.lang.Long anParentDirectoryId)
This method gets all the ids of all the sub directories for the given parent directory id.
|
java.util.ArrayList | getAllSubDirectoryIds(java.lang.String astrStoreDirectory, java.lang.String astrParentPath)
This method gets all the ids of all the sub directories for the store directory and given parent directory full path.
|
java.util.ArrayList | getChildsFromParentId(java.lang.Long anParentId)
This method returns the first level child directories of the given parent directory.
|
java.lang.Long | getIdFromParentIdAndDirectoryName(java.lang.Long anParentId, java.lang.String astrDirectoryName)
This method gets the id a given parent directory id and directory name.
|
java.lang.Long | getIdFromStoreDirectoryAndPath(java.lang.String astrStoreDir, java.lang.String astrPathName)
This method will return the content managed file directory id for a given store directory and path.
|
protected java.util.Vector | parseDirectoryPath(java.lang.String astrPath)
This method parses the given directory path astrpath from top to bottom, obtains each directory name from the path and places them in a Vector.
|
protected void | setDBConnection(java.sql.Connection connection)
This method sets the database connection.
|
public static final java.lang.String COPYRIGHT
public static final java.lang.Long DEFAULT_STORE_DIRECTORY_PARENT_ID
public static final java.lang.String DEFAULT_DIRECTORY_SEPARATOR
public ManagedFileDirectoryUtility(java.sql.Connection connection) throws java.sql.SQLException
public ManagedFileDirectoryUtility(java.sql.Connection connection, boolean insideCommerceEnvironment) throws java.sql.SQLException
public java.lang.Long getIdFromParentIdAndDirectoryName(java.lang.Long anParentId, java.lang.String astrDirectoryName) throws java.sql.SQLException
protected java.util.Vector parseDirectoryPath(java.lang.String astrPath)
public java.lang.Long createDirectory(java.lang.String astrStoreDirectory, java.lang.String astrPathName) throws java.sql.SQLException
This method will first check if the path name astrPathName already exists for the store directory astrStoreDirectory.
If the path name astrPathName already exists for the store directory astrStoreDirectory, this method will do nothing. It will simply return the content managed file directory id for this path.
If the path name astrPathName does not exist for the store directory astrStoreDirectory, it will try to create the directory. If the store directory astrStoreDirectory is not found, this method will first create the store directory. This method will then check the directory astrPathName and its ancestor directories. If any directory on the path is not in the database, it will be created.
Note that the astrPathName is the directory full path name which is the relative directory to the store directory name.
The new directory name found on the astrPathName will be stored as the DISPLAYNAME field in the database. The code will convert the directory name to lower case letters and store it in the IDENTIFIER field.
If the astrPathName is an empty string and the store directory does not exist in the database, the utility will do two things. It will create the store directory and return its directory id.
If the astrPathName is an empty string and the store directory exists in the database, the utility will just return its directory id.
public java.lang.Long getIdFromStoreDirectoryAndPath(java.lang.String astrStoreDir, java.lang.String astrPathName) throws java.sql.SQLException
public java.util.ArrayList getChildsFromParentId(java.lang.Long anParentId) throws java.sql.SQLException
public java.util.ArrayList getAllSubDirectoryIds(java.lang.Long anParentDirectoryId) throws java.sql.SQLException
public java.util.ArrayList getAllSubDirectoryIds(java.lang.String astrStoreDirectory, java.lang.String astrParentPath) throws java.sql.SQLException
protected void setDBConnection(java.sql.Connection connection) throws java.sql.SQLException
public int deleteDirectoryRecord(java.lang.Long aDirId) throws java.sql.SQLException