Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;

public class Main {
    private static void addDummyFile(Path directory, String fileName, int size) throws IOException {
        byte[] content = new byte[size];
        for (int i = 0; i < content.length; i++) {
            content[i] = (byte) i;
        }

        Files.createDirectories(directory);
        Files.write(directory.resolve(fileName), content);
    }
}