|
|||||||||||
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 | |
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 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 |
java.lang.String |
start(java.lang.String remoteHost,
java.lang.String userName,
java.lang.String password)
Open a connection to a server or a specific resource. |
void |
stop()
Close the current connection |
Method Detail |
public java.lang.String start(java.lang.String remoteHost, java.lang.String userName, java.lang.String password) throws ResourceException
remoteHost
- The Remote server IP locationuserName
- The user account namepassword
- The user password name
ResourceException
- If the connection cannot be openedpublic void stop()
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 |