uk.me.nxg.enormity.util
Enum FileMaker
java.lang.Object
java.lang.Enum<FileMaker>
uk.me.nxg.enormity.util.FileMaker
- All Implemented Interfaces:
- Serializable, Comparable<FileMaker>
public enum FileMaker
- extends Enum<FileMaker>
Creates temporary files on demand. This is different from
File.createTempFile because we want to be able to create named
pipes, too, and we might as well combine the functionality, so
there's just one place to clean up. That said, the functionality
that requires the named pipes isn't working right now, so this
isn't exercised.
FIXME: rather than worry about having to clear up the temporary
directory, the tempFileName() method here simply uses the
File.createTempFile() method, making this whole class a bit
redundant. However I do hope in future to work out why the named
pipes aren't working, and so to resurrect this. When that happens,
it might be worth moving makeWorkDirectory back into the
constructor, and making tempDir and pipeQueue final again.
INSTANCE
public static final FileMaker INSTANCE
values
public static FileMaker[] values()
- Returns an array containing the constants of this enum type, in
the order they are declared. This method may be used to iterate
over the constants as follows:
for (FileMaker c : FileMaker.values())
System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in
the order they are declared
valueOf
public static FileMaker valueOf(String name)
- Returns the enum constant of this type with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this type. (Extraneous whitespace characters are
not permitted.)
- Parameters:
name
- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is null
getInstance
public static final FileMaker getInstance()
tempFileName
public File tempFileName()
throws IOException
- Throws:
IOException
getNamedPipe
public File getNamedPipe()
releaseNamedPipe
public void releaseNamedPipe(File fifo)
Copyright © 2012. All Rights Reserved.