public class ResourceWriter extends Object
Constructor and Description |
---|
ResourceWriter() |
Modifier and Type | Method and Description |
---|---|
String |
getHistoryStorage()
Gets the file history storage location.
|
long |
getWrittenCount()
Gets the number of currently written resources over the course of this instance's history.
|
static ResourceWriter |
instance()
Gets the shared ResourceWriter instance.
|
boolean |
isHistoryBefore(long time)
Checks to see if the history is before the given
time . |
void |
resetHistory(String modelUri)
Resets the a history file, to write the history
writeHistory() must be called. |
void |
setEncoding(String encoding)
Sets the encoding to which all output written from this class will be
written.
|
void |
setHistoryStorage(String historyDirIn)
Sets the file history storage location.
|
void |
writeHistory()
Writes the output history to disk.
|
void |
writeStringToFile(String string,
File file)
Writes the string to the file specified by the fileLocation argument.
|
void |
writeStringToFile(String string,
File file,
String namespace)
Writes the string to the file specified by the fileLocation argument.
|
void |
writeStringToFile(String string,
String fileLocation)
Writes the string to the file specified by the fileLocation argument.
|
void |
writeStringToFile(String string,
String fileLocation,
String namespace)
Writes the string to the file specified by the fileLocation argument.
|
void |
writeUrlToFile(URL url,
String fileLocation)
Writes the URL contents to a file specified by the fileLocation argument.
|
public ResourceWriter()
public static ResourceWriter instance()
public void writeStringToFile(String string, File file, String namespace) throws IOException
string
- the string to write to the filefile
- the file to which to write.namespace
- the current namespace for which this resource is being
written.IOException
public void writeStringToFile(String string, String fileLocation) throws IOException
string
- the string to write to the filefileLocation
- the location of the file which to write.IOException
public void writeStringToFile(String string, File file) throws IOException
string
- the string to write to the filefile
- the file which to write.IOException
public void writeStringToFile(String string, String fileLocation, String namespace) throws IOException
string
- the string to write to the filefileLocation
- the location of the file which to write.namespace
- the current namespace for which this resource is being
written.IOException
public void writeUrlToFile(URL url, String fileLocation) throws IOException
url
- the URL to readfileLocation
- the location which to write.IOException
public void setEncoding(String encoding)
encoding
- the encoding type (UTF-8, ISO-8859-1, etc).public void resetHistory(String modelUri)
writeHistory()
must be called.modelUri
- used to construct the file name from the modelUri where the history is storedpublic long getWrittenCount()
public String getHistoryStorage()
public void setHistoryStorage(String historyDirIn)
historyDirIn
- the history file storage locationpublic void writeHistory() throws IOException
IOException
public boolean isHistoryBefore(long time)
time
.time
- the time in milliseconds to check against.Copyright © 2003–2014 AndroMDA.org. All rights reserved.