Package org.duracloud.client.util
Class DuracloudFileWriter
java.lang.Object
java.io.Writer
org.duracloud.client.util.DuracloudFileWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
This class encapsulates writing a simple text file and saving it as a content
item.
- Author:
- Danny Bernstein Date: Jan 4, 2011
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDuracloudFileWriter(String spaceId, String contentId, String mimetype, ContentStore contentStore) -
Method Summary
-
Constructor Details
-
DuracloudFileWriter
public DuracloudFileWriter(String spaceId, String contentId, String mimetype, ContentStore contentStore) throws DuraCloudRuntimeException - Parameters:
spaceId- of the space in which you would like to persist the text.contentId- of the item you would like to store the text in.contentStore- to which you would like write the stream.- Throws:
DuraCloudRuntimeException
-
-
Method Details
-
flush
Writes the tempfile to durastore.- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
writeLine
Same as write but appends a new line to the end of the supplied line.- Parameters:
line-- Throws:
DuraCloudRuntimeExceptionIOException
-
write
- Overrides:
writein classWriter- Throws:
IOException
-
finalize
-
write
- Specified by:
writein classWriter- Throws:
IOException
-