public class TempDirSecondaryStorage extends java.lang.Object implements SecondaryStorage
| Modifier and Type | Field and Description |
|---|---|
protected static java.util.logging.Logger |
logger |
| Constructor and Description |
|---|
TempDirSecondaryStorage(long memoryLimitBeforeUse) |
TempDirSecondaryStorage(long memoryLimitBeforeUse,
java.io.File tempDirectory) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
This allows you to ask the secondary storage to clean up after itself.
|
protected void |
cleanupImplementation() |
protected void |
ensureIsOpen() |
long |
getMemoryLimitBeforeUse()
Returns the number of characters that should be stored in memory before this secondary storage.
|
java.io.File |
getTempDirectory() |
protected java.io.File |
getTempFile()
By default creates a temporary file in
getTempDirectory(). |
void |
write(char[] chars,
int off,
int len) |
void |
write(int c) |
void |
write(java.lang.String str) |
void |
write(java.lang.String str,
int off,
int len) |
void |
writeTo(java.io.Writer out)
This method will close the "secondary storage" and write the captured output
to the specified output writer.
|
public TempDirSecondaryStorage(long memoryLimitBeforeUse)
public TempDirSecondaryStorage(long memoryLimitBeforeUse,
java.io.File tempDirectory)
public long getMemoryLimitBeforeUse()
SecondaryStoragegetMemoryLimitBeforeUse in interface SecondaryStoragepublic java.io.File getTempDirectory()
protected void ensureIsOpen()
protected java.io.File getTempFile()
throws java.io.IOException
getTempDirectory(). The Java File.createTempFile(String, String, java.io.File) ensures
that the file is unique.java.io.IOExceptionpublic void write(int c)
throws java.io.IOException
write in interface SecondaryStoragejava.io.IOExceptionWriter.write(int)public void write(char[] chars,
int off,
int len)
throws java.io.IOException
write in interface SecondaryStoragejava.io.IOExceptionWriter.write(char[], int, int)public void write(java.lang.String str,
int off,
int len)
throws java.io.IOException
write in interface SecondaryStoragejava.io.IOExceptionWriter.write(String, int, int)public void write(java.lang.String str)
throws java.io.IOException
write in interface SecondaryStoragejava.io.IOExceptionWriter.write(String)public void writeTo(java.io.Writer out)
throws java.io.IOException
SecondaryStoragewriteTo in interface SecondaryStorageout - the output writer to send the stored datajava.io.IOException - if the data cant be writtenpublic void cleanUp()
SecondaryStoragecleanUp in interface SecondaryStorageprotected void cleanupImplementation()
throws java.io.IOException
java.io.IOException