Example usage for org.apache.poi.util TempFile JAVA_IO_TMPDIR

List of usage examples for org.apache.poi.util TempFile JAVA_IO_TMPDIR

Introduction

In this page you can find the example usage for org.apache.poi.util TempFile JAVA_IO_TMPDIR.

Prototype

String JAVA_IO_TMPDIR

To view the source code for org.apache.poi.util TempFile JAVA_IO_TMPDIR.

Click Source Link

Document

Define a constant for this property as it is sometimes mistypes as "tempdir" otherwise

Usage

From source file:com.github.poi.XlsxUtils.java

License:Apache License

public static void checkTempFiles() throws IOException {
    String tmpDir = System.getProperty(TempFile.JAVA_IO_TMPDIR) + "/poifiles";
    File tempDir = new File(tmpDir);
    if (tempDir.exists()) {
        String[] tempFiles = tempDir.list();
        if (tempFiles.length > 0) {
            System.out.println("found files in poi temp dir " + tempDir.getAbsolutePath());
            for (String filename : tempDir.list()) {
                System.out.println("file: " + filename);
            }/*from w  ww  .  java  2  s  .c o  m*/
        }
    } else {
        System.out.println("unable to find poi temp dir");
    }
}

From source file:org.apache.poi.examples.util.TempFileUtils.java

License:Apache License

public static void checkTempFiles() throws IOException {
    String tmpDir = System.getProperty(TempFile.JAVA_IO_TMPDIR) + "/poifiles";
    File tempDir = new File(tmpDir);
    if (tempDir.exists()) {
        String[] tempFiles = tempDir.list();
        if (tempFiles != null && tempFiles.length > 0) {
            System.out.println("found files in poi temp dir " + tempDir.getAbsolutePath());
            for (String filename : tempFiles) {
                System.out.println("file: " + filename);
            }/*from ww  w. j  av a2 s . c o  m*/
        }
    } else {
        System.out.println("unable to find poi temp dir");
    }
}