otmpfile

otmpfile - O_TMPFILE backed temporary files for Java

License

License

GroupId

GroupId

io.webfolder
ArtifactId

ArtifactId

otmpfile
Last Version

Last Version

1.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

otmpfile
otmpfile - O_TMPFILE backed temporary files for Java
Project URL

Project URL

https://github.com/webfolderio/otmpfile
Project Organization

Project Organization

WebFolder OÜ
Source Code Management

Source Code Management

https://github.com/webfolderio/otmpfile.git

Download otmpfile

How to add to project

<!-- https://jarcasting.com/artifacts/io.webfolder/otmpfile/ -->
<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>otmpfile</artifactId>
    <version>1.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/io.webfolder/otmpfile/
implementation 'io.webfolder:otmpfile:1.0.3'
// https://jarcasting.com/artifacts/io.webfolder/otmpfile/
implementation ("io.webfolder:otmpfile:1.0.3")
'io.webfolder:otmpfile:jar:1.0.3'
<dependency org="io.webfolder" name="otmpfile" rev="1.0.3">
  <artifact name="otmpfile" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.webfolder', module='otmpfile', version='1.0.3')
)
libraryDependencies += "io.webfolder" % "otmpfile" % "1.0.3"
[io.webfolder/otmpfile "1.0.3"]

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

otmpfile

O_TMPFILE backed temporary files for Java.

License

What is O_TMPFILE?

O_TMPFILE is a Linux-specific flag for open(), that allows creation of already-unlinked temporary files, that don't need to be explicitly removed via unlink. This means that you could create a temp file without name. This is wrapper library to use O_TMPFILE from Java.

How to Use?

SecureTempFile tmp = new SecureTempFile();

// Create and write temp file without giving a name
try (FileOutputStream fs = new FileOutputStream(stf.getFileDescriptor())) {
  fs.write("foo".getBytes());
}

// Optionally set the file name
String tempFilePath = SecureTempFile.TEMP_DIR + File.separator + "my-temp-file.tmp";
tmp.setName(tempFilePath);

Articles

Automatic Deletion of Incomplete Output Files

open() flags: O_TMPFILE and O_BENEATH

How to make temporary files

O_TMPFILE flag linux - 3.11

Supported Java Versions

Oracle & OpenJDK Java 8, 11.

Both the JRE and the JDK are suitable for use with this library.

Supported Platforms

otmpfile has been tested under Ubuntu, but should work on any platform where a GNU/Linux 3.11 Kernel available.

Integration with Maven

To use the official release of otmpfile, please use the following snippet in your pom.xml file.

Add the following to your POM's <dependencies> tag:

<dependency>
    <groupId>io.webfolder</groupId>
    <artifactId>otmpfile</artifactId>
    <version>1.1.0</version>
</dependency>

License

This project licensed under the MIT License.

Download

otmpfile-1.1.0.jar

otmpfile-1.1.0-sources.jar

Author

WebFolder OÜ

Versions

Version
1.0.3
1.0.1
1.0.0