|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sas.drugdev.remote.repository.NodeBean
com.sas.drugdev.remote.repository.FileBean
public class FileBean
Simple bean to represent a file. This can be constructed various ways. This class allows the user
to construct a File
object without requiring a server call.
It is the only way to create a File on the server. Construct a FileBean, then pass it into
RepositoryService.createFile(FileBean)
.
It is also the only means for performing write operations on the File, such as updating content
and metadata. Construct a FileBean object then call NodeBean.setProperties(java.util.Map)
NodeBean.setProperty(String, String)
or setContents(InputStream)
method. Then pass
that bean into RepositoryService.updateNode(NodeBean)
to perform those operations
on the server side.
Field Summary |
---|
Constructor Summary | |
---|---|
FileBean(NodeId id)
Constructor that takes only an NodeId. |
|
FileBean(NodeId id,
FileVersion version)
Construct a FileBean that points to a particular version of the file with the given id. |
|
FileBean(RemoteFile remoteFile)
Constructor that takes a RemoteFile. |
|
FileBean(java.lang.String path)
Construct a FileBean with just the path. |
|
FileBean(java.lang.String path,
FileVersion version)
Construct a FileBean that points to a particular version of the file at the given path. |
|
FileBean(java.lang.String path,
Type type)
Construct the FileBean with a type and a path. |
Method Summary | |
---|---|
java.io.InputStream |
getContents()
Gets the contents of the file as an InputStream. |
java.io.File |
getFileContents()
Gets the contents of the file as a File. |
FileVersion |
getVersion()
Get the version of this file |
void |
setContents(java.io.File localFile)
Sets the contents of a file with the contents of the local file passed in. |
void |
setContents(java.io.InputStream contents)
Set the contents of the file. |
Methods inherited from class com.sas.drugdev.remote.repository.NodeBean |
---|
getId, getPath, getProperties, getType, setProperties, setProperty |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sas.drugdev.remote.repository.Node |
---|
getId, getPath, getProperties, getType |
Constructor Detail |
---|
public FileBean(NodeId id)
id
- id with which to populate the FileBeanpublic FileBean(RemoteFile remoteFile)
remoteFile
- remoteFile with which to populate the FileBeanpublic FileBean(java.lang.String path)
path
- path with which to populate the FileBeanpublic FileBean(java.lang.String path, FileVersion version)
path
- path of the fileversion
- version of the filepublic FileBean(NodeId id, FileVersion version)
id
- id of the fileversion
- version of the filepublic FileBean(java.lang.String path, Type type)
path
- path of the file you are creatingtype
- type of the file you are creatingMethod Detail |
---|
public void setContents(java.io.InputStream contents)
RepositoryService.updateNode(NodeBean)
or
RepositoryService.createFile(FileBean)
.
contents
- InputStream to use as the contents of this file.public void setContents(java.io.File localFile)
RepositoryService.updateNode(NodeBean)
or
RepositoryService.createFile(FileBean)
.
localFile
- File object pointing to a local file.public FileVersion getVersion()
File
getVersion
in interface File
public java.io.InputStream getContents()
public java.io.File getFileContents()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |