List of utility methods to do Path Create nio
void | clearAndCreate(Path dir) clear And Create if (Files.exists(dir)) {
deleteDirectory(dir);
Files.createDirectory(dir);
|
void | createACL(Path root, Path p, GroupPrincipal readOnly, GroupPrincipal readWrite) create ACL final AclFileAttributeView av = Files.getFileAttributeView(p, AclFileAttributeView.class, LinkOption.NOFOLLOW_LINKS); if (av == null) { throw new UnsupportedOperationException("AclFileAttributeView for " + p); final PosixFileAttributes attrs = Files.readAttributes(p, PosixFileAttributes.class, LinkOption.NOFOLLOW_LINKS); List<AclEntry> acls = av.getAcl(); ... |
Writer | createAndGetOutputStream(String typename, String outputPath) create And Get Output Stream if (typename.indexOf('$') > 0) { System.out.println(typename); typename = typename.substring(0, typename.lastIndexOf('.')) + "." + typename.substring(typename.indexOf('$') + 1); File file = new File(outputPath, typename.replace('.', File.separatorChar) + ".java"); file.getParentFile().mkdirs(); file.createNewFile(); ... |
BufferedReader | createBufferedReader(Path path) create Buffered Reader BufferedReader reader = new BufferedReader( new InputStreamReader(new FileInputStream(path.toString()), "UTF-8")); return reader; |
Map | createChecksums(final Path file, final Map create Checksums if (functions.isEmpty()) { return Collections.emptyMap(); final Map<String, Hasher> hasherMap = new HashMap<>(); final Hasher[] hashers = new Hasher[functions.size()]; int i = 0; for (final Map.Entry<String, HashFunction> entry : functions.entrySet()) { hashers[i] = entry.getValue().newHasher(); ... |
void | createClassWithDepsNextExtra(int index, Path dir) create Class With Deps Next Extra writeLinesToFile(dir.resolve("Deps" + index + CPP_HEADER_FILE_SUFFIX), "class Deps" + index + " {", "public:", " static void printSth();", " static void printSthElse();", " static void callNext();", "};"); writeLinesToFile(dir.resolve("Deps" + index + CPP_FILE_SUFFIX), "#include <random>", "#include <iostream>", "#include <ctime>", "#include \"Deps" + (index + 1) + ".h\"", "using namespace std;", "", "class Deps" + index + " {", "public:", " static void printSth() {", " srand(time(NULL));", " int n = rand();", " cout << \"This is method(printSth) with random number(\" << n << \")\\n\";", " }", ... |
void | createDir(Path p) create Dir File file = p.toFile(); file.mkdir(); |
void | createDirectoriesIfRequired(@Nonnull Path path) create Directories If Required if (!exists(path)) {
createDirectories(path);
|
Path | createDirectory(final Path parent, final String folderName) Creates a new directory with the given parent folder and folder name. final File file = new File(parent.toFile(), folderName); if (!file.exists()) { if (!file.mkdir()) { throw new RuntimeException( "Error while trying to create folder at " + parent + " with " + folderName + "."); file.deleteOnExit(); ... |
Path | createDirectory(Path parent, String name) Create a directory (recursively) Path path = null; try { File directory = new File(parent.toFile(), name); if (!directory.exists()) { if (directory.mkdirs()) { path = directory.toPath(); } else if (directory.isDirectory()) { ... |