Created
November 12, 2019 12:49
-
-
Save dmikurube/cbffa64b5d4c6997562f62b6c5ad8498 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.IOException; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
public class FileFiles { | |
public static void main(final String[] args) throws IOException { | |
final File ofFile = File.createTempFile("fooA/barA", ".tmp", new File("/tmp")); | |
System.out.println(ofFile.toString()); | |
Path ofFiles1 = null; | |
try { | |
ofFiles1 = Files.createTempFile(Paths.get("/tmp"), "fooB/barB", ".tmp"); | |
} catch (final IllegalArgumentException ex) { | |
System.out.println(ex.toString()); | |
} | |
if (ofFiles1 != null) { | |
System.out.println(ofFiles1.toString()); | |
} | |
Path ofFiles2 = null; | |
try { | |
ofFiles2 = Files.createTempFile(Paths.get("/tmp"), "fooC", ".tmp"); | |
} catch (final IllegalArgumentException ex) { | |
System.out.println(ex.toString()); | |
} | |
if (ofFiles2 != null) { | |
System.out.println(ofFiles2.toString()); | |
} | |
} | |
} |
Author
dmikurube
commented
Nov 12, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment