|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kohsuke.jnt.JNFileFolder
public final class JNFileFolder
folder in the java.net file sharing section.
In java.net, the "documents & files" section serves as a simle per-project file system. This object represents one folder in such a file system.
Method Summary | |
---|---|
JNFileFolder |
createFolder(String name,
String description)
Creates a new sub-folder in this folder. |
void |
delete()
Removes this folder. |
void |
deleteFile(String fileName)
Deprecated. use getFiles().get(fileName).delete() |
boolean |
equals(Object o)
|
boolean |
existsFile(String fileName)
Deprecated. use getFiles().containsKey(fileName) |
JNFile |
getFile(String fileName)
Gets a file in this folder. |
Map<String,JNFile> |
getFiles()
Returns the files in this folder. |
int |
getId()
Gets the unique ID that distinguishes this folder. |
String |
getName()
Gets the name of this folder. |
JNFileFolder |
getParent()
Returns the parent folder, or null if this folder is the root. |
JNFileFolder |
getSubFolder(String folderName)
Returns a sub-folder. |
Map<String,JNFileFolder> |
getSubFolders()
Returns the subfolders of this folder. |
int |
hashCode()
|
boolean |
isRoot()
Returns true if this is the root folder of a project. |
JNFile |
linkUrl(String fileName,
String description,
FileStatus status,
URL link)
Creates a link to an URL. |
JNFile |
uploadFile(String fileName,
String description,
FileStatus fileStatus,
File fileToUpload)
Uploads a file to the folder. |
JNFile |
uploadFile(String fileName,
String description,
FileStatus fileStatus,
InputStream data,
String contentType)
Uploads a file from a source other than File . |
void |
uploadFile(String fileName,
String description,
String fileStatus,
File fileToUpload)
Deprecated. use uploadFile(String, String, FileStatus, File) |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public JNFileFolder getSubFolder(String folderName) throws ProcessingException
folderName
- '/'-separated folder name. such as "abc", "abc/def", or "/abc/def".
ProcessingException
public JNFileFolder getParent()
public String getName()
For the root folder, this method returns the name of the project.
public int getId()
The uniqueness is within a project.
public boolean isRoot()
public Map<String,JNFileFolder> getSubFolders() throws ProcessingException
ProcessingException
public Map<String,JNFile> getFiles() throws ProcessingException
ProcessingException
public JNFile getFile(String fileName) throws ProcessingException
Convenience method for getFiles().get(fileName)
.
ProcessingException
public void uploadFile(String fileName, String description, String fileStatus, File fileToUpload) throws ProcessingException
uploadFile(String, String, FileStatus, File)
fileStatus
- can be null.
ProcessingException
public JNFile uploadFile(String fileName, String description, FileStatus fileStatus, File fileToUpload) throws ProcessingException
fileStatus
- can be null.
ProcessingException
public JNFile uploadFile(String fileName, String description, FileStatus fileStatus, InputStream data, String contentType) throws ProcessingException
File
.
data
- The InputStream
uploaded as a file.contentType
- The MIME type of the file to be uploaded, such as "text/plain" or "application/x-zip-compressed".
java.net server doesn't seem to be using this information, so it could be just "application/octet-stream".
ProcessingException
public JNFile linkUrl(String fileName, String description, FileStatus status, URL link) throws ProcessingException
ProcessingException
public JNFileFolder createFolder(String name, String description) throws ProcessingException
This is an admin only operation
ProcessingException
public void delete() throws ProcessingException
ProcessingException
public boolean existsFile(String fileName) throws ProcessingException
getFiles().containsKey(fileName)
ProcessingException
public void deleteFile(String fileName) throws ProcessingException
getFiles().get(fileName).delete()
ProcessingException
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |