|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is a common interface for browsing and managing a kind resource. This interface is used by the ResourceBrowserPanel for letting the final user browses the content and acts on this content. A Resource is any remote contents containing directories and files. For sample, if you need to list an FTP server account, you will have to implement or use an class implementing this interface. By default JResourceBrowser supports ZIP/JAR,FTP,WEBDAV
ResourceBrowserPanel
Method Summary | |
java.lang.String |
connect(java.lang.String host,
java.lang.String user,
java.lang.String password)
Open a connection to a server or a specific resource. |
void |
deleteFile(ResourceItem path)
Delete a file or an empty directory for this path |
void |
disconnect()
Close the current connection |
byte[] |
getContent(ResourceItem path)
|
boolean |
isConnectionSupported()
|
boolean |
isLockSupported()
|
ResourceItemModel |
list(ResourceItem path)
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 |
Method Detail |
public java.lang.String connect(java.lang.String host, java.lang.String user, java.lang.String password) throws ResourceException
host
- The Remove server IP locationuser
- The user account namepassword
- The user password name
ResourceException
- If the connection cannot be openedpublic void disconnect()
public ResourceItemModel list(ResourceItem path) throws ResourceException
path
- A directory
ResourceException
- If the listing is not possiblepublic byte[] getContent(ResourceItem path) throws ResourceException
path
- A location for a file
java.lang.String
ResourceException
- If the file cannot be downloadedpublic void setContent(ResourceItem path, byte[] content) throws ResourceException
path
- A file locationcontent
- A new content
ResourceException
- If the file cannot be updatedpublic void deleteFile(ResourceItem path) throws ResourceException
path
- A file or an empty directory location
ResourceException
- If the file cannot be deletedpublic void renameFile(ResourceItem path, java.lang.String newPathName) throws ResourceException
path
- A file or a directorynewPathName
- A new name
ResourceException
- If the file or the directory cannot be renammedpublic void lock(ResourceItem path, boolean locked) throws ResourceException
isLockSupported
method returns true
path
- A file or a directorylocked
- true
for locking the resource path
ResourceException
- If the file cannot be lockedpublic boolean isLockSupported()
true
if the file lock if supportedpublic boolean isConnectionSupported()
if an host, user and password is required before browing a content
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |