|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.japisoft.filebrowser.FileResourceManager
Constructor Summary | |
FileResourceManager()
|
|
FileResourceManager(java.io.File rootPath)
|
Method Summary | |
void |
deleteFile(ResourceItem path)
Delete a file or an empty directory for this path |
byte[] |
getContent(ResourceItem path)
|
boolean |
isConnectionSupported()
|
boolean |
isLockSupported()
|
ResourceItemModel |
list(ResourceItem item)
List a directory |
void |
lock(ResourceItem path,
boolean locked)
Lock this resource located at the path. |
void |
renameFile(ResourceItem path,
java.lang.String newPathName)
Rename a file name to another one. |
void |
setContent(ResourceItem path,
byte[] content)
Reset a content located at this path |
java.lang.String |
start(java.lang.String host,
java.lang.String user,
java.lang.String password)
Open a connection to a server or a specific resource. |
void |
stop()
Close the current connection |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileResourceManager()
public FileResourceManager(java.io.File rootPath)
Method Detail |
public java.lang.String start(java.lang.String host, java.lang.String user, java.lang.String password) throws ResourceException
ResourceManager
start
in interface ResourceManager
host
- The Remote server IP locationuser
- The user account namepassword
- The user password name
ResourceException
- If the connection cannot be openedpublic void deleteFile(ResourceItem path) throws ResourceException
ResourceManager
deleteFile
in interface ResourceManager
path
- A file or an empty directory location
ResourceException
- If the file cannot be deletedpublic byte[] getContent(ResourceItem path) throws ResourceException
getContent
in interface ResourceManager
path
- A location for a file
java.lang.String
ResourceException
- If the file cannot be downloadedpublic void stop()
ResourceManager
stop
in interface ResourceManager
public boolean isConnectionSupported()
isConnectionSupported
in interface ResourceManager
if an host, user and password is required before browing a content
public boolean isLockSupported()
isLockSupported
in interface ResourceManager
true
if the file lock if supportedpublic ResourceItemModel list(ResourceItem item) throws ResourceException
ResourceManager
list
in interface ResourceManager
item
- A directory
ResourceException
- If the listing is not possiblepublic void lock(ResourceItem path, boolean locked) throws ResourceException
ResourceManager
isLockSupported
method returns true
lock
in interface ResourceManager
path
- A file or a directorylocked
- true
for locking the resource path
ResourceException
- If the file cannot be lockedpublic void renameFile(ResourceItem path, java.lang.String newPathName) throws ResourceException
ResourceManager
renameFile
in interface ResourceManager
path
- A file or a directorynewPathName
- A new name
ResourceException
- If the file or the directory cannot be renammedpublic void setContent(ResourceItem path, byte[] content) throws ResourceException
ResourceManager
setContent
in interface ResourceManager
path
- A file locationcontent
- A new content
ResourceException
- If the file cannot be updated
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |