|
Sonic Management API | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sonicsw.mx.config.util.SonicFSFileSystem
public class SonicFSFileSystem
This class provides an API for accessing files stored in the DS using sonicfs://
Field Summary | |
---|---|
static java.util.Comparator |
COMPARATOR
|
static java.lang.String |
SCHEME
|
static java.lang.String |
separator
|
static char |
separatorChar
|
Constructor Summary | |
---|---|
SonicFSFileSystem(IDirectoryFileSystemService dfs,
java.lang.String user)
Note: This constructor is for internal use only. |
|
SonicFSFileSystem(JMSConnectorClient connector,
java.lang.String domain,
java.lang.String user)
Constuctor for the SonicFSFileSystem. |
Method Summary | |
---|---|
void |
close()
Close the DS if local to this JVM |
SonicFSFile |
createDirectory(SonicFSFile baseFolder,
java.lang.String newSubFolderName)
Create a directory under the specified subfolder |
SonicFSFile |
createDirectory(java.lang.String path)
Create the specified directory. |
void |
createDirectoryPath(java.lang.String path)
Create the specified directory. |
void |
createFile(java.lang.String path,
byte[] content)
Create a file in sonicfs with the specified file name and the specified content. |
void |
createFile(java.lang.String path,
java.io.File file)
Create a file in sonicfs with the specified file name and the specified content. |
void |
createFile(java.lang.String path,
java.io.InputStream stream,
int size)
Create a file in sonicfs with the specified file name and the specified content. |
void |
createFile(java.lang.String path,
java.lang.String content)
Create a file in sonicfs with the specified file name and the specified content. |
void |
deleteDirectory(java.lang.String path)
Delete the specified directory. |
void |
deleteDirectoryPath(java.lang.String path)
Recursively delete all files and folders under the specified path including the path folder itself. |
void |
deleteFile(java.lang.String path)
Delete the specified file. |
void |
deleteFiles(java.lang.String path)
|
boolean |
exists(java.lang.String path)
Check to see if a path is valid in the DS |
java.lang.String |
getContent(java.lang.String path)
Get the content of the specified file returning the content as a String |
byte[] |
getContentBytes(java.lang.String path)
Get the content of the specified file returning the content as a byte[] |
SonicFSFile |
getDetails(java.lang.String path)
Get detailed information about the specified file or folder |
SonicFSFile[] |
getDetails(java.lang.String[] path)
Get detailed information for a set of specified DS locations |
IDirectoryFileSystemService |
getDirectoryService()
Get the directory service being used for this SonicFSFileSystem |
SonicFSFile |
getFileDetails(java.lang.String path)
Get detailed information about the specified file. |
java.lang.String |
getRoot()
Get the root folder as a String. |
SonicFSFile |
getRootFile()
Get the root folder as a SonicFSFile object. |
java.lang.String |
getUser()
Get the user name associated with this SonicFSFileSystem |
void |
importFiles(java.lang.String fsPath,
java.lang.String dsPath)
|
boolean |
isDirectory(java.lang.String path)
Check to see if a path is a valid directory in the DS |
boolean |
isFile(java.lang.String path)
Check to see if a path is a valid file in the DS |
java.lang.String[] |
list(java.lang.String path)
List the contents of the DS at the specified path. |
java.lang.String[] |
list(java.lang.String path,
boolean listSubFolders)
List the contents of the DS at the specified path. |
SonicFSFile[] |
listAllFolderDetails()
Obtain a listing of the DS contents at the specified location returning the information as an arrange of SonicFSFile objects. |
java.lang.String[] |
listAllFolders()
Obtain a recursive listing of all folders within the DS |
SonicFSFile[] |
listDetails(java.lang.String path)
Obtain a listing of the DS contents at the specified location returning the information as an array of SonicFSFile objects. |
SonicFSFile[] |
listFolderDetails(java.lang.String path)
Obtain a listing of the DS contents at the specified location returning the information as an arrange of SonicFSFile objects. |
java.lang.String[] |
listFolders(java.lang.String path)
List the contents of the DS at the specified path. |
static void |
main(java.lang.String[] args)
|
SonicFSFile |
rename(SonicFSFile oldFile,
java.lang.String newName)
Rename either a folder or a file where the original object is identied by the specified SonicFSFile object and the new name is specified as a String. |
void |
rename(java.lang.String oldPath,
java.lang.String newPath)
Rename either a folder or a file from oldPath to newPath |
void |
updateFile(java.lang.String path,
byte[] content,
boolean create)
|
void |
updateFile(java.lang.String path,
java.io.File file,
boolean create)
Update the contents of the specified file where the content is stored in the specified file. |
void |
updateFile(java.lang.String path,
java.io.InputStream stream,
boolean create,
int size)
Update the contents of the specified file using the given byte[] contents. |
void |
updateFile(java.lang.String path,
java.lang.String content,
boolean create)
Update the contents of the specified file using the given string contents. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.util.Comparator COMPARATOR
public static final java.lang.String SCHEME
public static final java.lang.String separator
public static final char separatorChar
Constructor Detail |
---|
public SonicFSFileSystem(IDirectoryFileSystemService dfs, java.lang.String user)
dfs
- The Directory Service being accesseduser
- The name of the user (will be written into sonicfs elements)public SonicFSFileSystem(JMSConnectorClient connector, java.lang.String domain, java.lang.String user) throws SonicFSException
connector
- The JMS Connection to use for the DS connectiondomain
- The name of the DS domainuser
- The name of the user (will be written into sonicfs elements)
SonicFSException
Method Detail |
---|
public void close() throws SonicFSException
SonicFSException
public SonicFSFile createDirectory(SonicFSFile baseFolder, java.lang.String newSubFolderName) throws SonicFSException
baseFolder
- newSubFolderName
-
SonicFSException
public SonicFSFile createDirectory(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public void createDirectoryPath(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public void createFile(java.lang.String path, byte[] content) throws SonicFSException
path
- The logical name of the file in the DScontent
- The contents as a byte array
SonicFSException
public void createFile(java.lang.String path, java.io.File file) throws SonicFSException
path
- The logical name of the filel in the DSfile
- The disk file with the contents for the DS file. An InputStream
will be created from this file and the contents read to create the new
DS file.
SonicFSException
- If there is a problem reading the file on diskpublic void createFile(java.lang.String path, java.io.InputStream stream, int size) throws SonicFSException
path
- The logical name of the file element in the DSstream
- The input stream for the contents of the filesize
- The size of the entire contents of the file.
SonicFSException
public void createFile(java.lang.String path, java.lang.String content) throws SonicFSException
path
- content
-
SonicFSException
public void deleteDirectory(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public void deleteDirectoryPath(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public void deleteFile(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public void deleteFiles(java.lang.String path) throws SonicFSException
SonicFSException
public boolean exists(java.lang.String path)
path
-
public java.lang.String getContent(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public byte[] getContentBytes(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public SonicFSFile getDetails(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public SonicFSFile[] getDetails(java.lang.String[] path) throws SonicFSException
path
-
SonicFSException
public IDirectoryFileSystemService getDirectoryService()
public SonicFSFile getFileDetails(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public java.lang.String getRoot()
public SonicFSFile getRootFile()
public java.lang.String getUser()
public void importFiles(java.lang.String fsPath, java.lang.String dsPath) throws SonicFSException
SonicFSException
public boolean isDirectory(java.lang.String path)
path
-
public boolean isFile(java.lang.String path)
path
-
public java.lang.String[] list(java.lang.String path) throws SonicFSException
path
- the DS path to list
SonicFSException
public java.lang.String[] list(java.lang.String path, boolean listSubFolders) throws SonicFSException
path
- the DS path to listlistSubFolders
- if 'true', lists subfolders recursively
SonicFSException
public SonicFSFile[] listAllFolderDetails() throws SonicFSException
SonicFSException
public java.lang.String[] listAllFolders() throws SonicFSException
SonicFSException
public SonicFSFile[] listDetails(java.lang.String path) throws SonicFSException
path
- the DS path to list
SonicFSException
public SonicFSFile[] listFolderDetails(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public java.lang.String[] listFolders(java.lang.String path) throws SonicFSException
path
-
SonicFSException
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public SonicFSFile rename(SonicFSFile oldFile, java.lang.String newName) throws SonicFSException
oldFile
- newName
-
SonicFSException
public void rename(java.lang.String oldPath, java.lang.String newPath) throws SonicFSException
oldPath
- newPath
-
SonicFSException
public void updateFile(java.lang.String path, byte[] content, boolean create) throws SonicFSException
SonicFSException
public void updateFile(java.lang.String path, java.io.File file, boolean create) throws SonicFSException
path
- The logical name of the file in the DSfile
- The disk file where the contents of the updated DS file are read fromcreate
- true if the file should be created if it's not already in the DS
SonicFSException
public void updateFile(java.lang.String path, java.io.InputStream stream, boolean create, int size) throws SonicFSException
path
- content
- create
-
SonicFSException
public void updateFile(java.lang.String path, java.lang.String content, boolean create) throws SonicFSException
path
- content
- create
-
SonicFSException
|
Sonic Management API | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |