Package software.amazon.awssdk.testutils
Class RandomTempFile
java.lang.Object
java.io.File
software.amazon.awssdk.testutils.RandomTempFile
- All Implemented Interfaces:
Serializable,Comparable<File>
Extension of File that creates a temporary file with a specified name in
Java's temporary directory, as declared in the JRE's system properties. The
file is immediately filled with a specified amount of random ASCII data.
- See Also:
-
Field Summary
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar -
Constructor Summary
ConstructorsConstructorDescriptionRandomTempFile(long sizeInBytes) Creates, and fills, a temp file with a randomly generated name and specified size of random ASCII data.RandomTempFile(File root, String filename, long sizeInBytes) RandomTempFile(String filename, int sizeInBytes) Creates, and fills, a temp file with the specified name and specified size of random ASCII data.RandomTempFile(String filename, long sizeInBytes) Creates, and fills, a temp file with the specified name and specified size of random ASCII data.RandomTempFile(String filename, long sizeInBytes, boolean binaryData) Creates, and fills, a temp file with the specified name and specified size of random binary or character data. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateFile(long sizeInBytes) booleandelete()booleanstatic FileMethods inherited from class java.io.File
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, deleteOnExit, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
-
Constructor Details
-
RandomTempFile
Creates, and fills, a temp file with a randomly generated name and specified size of random ASCII data.- Parameters:
sizeInBytes- The amount of random ASCII data, in bytes, for the new temp file.- Throws:
IOException- If any problems were encountered creating the new temp file.
-
RandomTempFile
Creates, and fills, a temp file with the specified name and specified size of random ASCII data.- Parameters:
filename- The name for the new temporary file, within the Java temp directory as declared in the JRE's system properties.sizeInBytes- The amount of random ASCII data, in bytes, for the new temp file.- Throws:
IOException- If any problems were encountered creating the new temp file.
-
RandomTempFile
Creates, and fills, a temp file with the specified name and specified size of random ASCII data.- Parameters:
filename- The name for the new temporary file, within the Java temp directory as declared in the JRE's system properties.sizeInBytes- The amount of random ASCII data, in bytes, for the new temp file.- Throws:
IOException- If any problems were encountered creating the new temp file.
-
RandomTempFile
Creates, and fills, a temp file with the specified name and specified size of random binary or character data.- Parameters:
filename- The name for the new temporary file, within the Java temp directory as declared in the JRE's system properties.sizeInBytes- The amount of random ASCII data, in bytes, for the new temp file.binaryData- Whether to fill the file with binary or character data.- Throws:
IOException- If any problems were encountered creating the new temp file.
-
RandomTempFile
- Throws:
IOException
-
-
Method Details
-
createFile
- Throws:
IOException
-
delete
public boolean delete() -
randomUncreatedFile
-
equals
-