Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: LGPL 

import java.io.File;

import java.io.IOException;

public class Main {
    public static boolean createFile(String filename) {
        final File file = new File(filename);
        final File pf = file.getParentFile();
        if (!pf.exists()) {
            pf.mkdirs();
        }
        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                e.printStackTrace();
                return false;
            }
        }
        return true;
    }
}