Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.File;

import java.net.URI;

public class Main {
    public static String[] getFolderFileNames(String aPath) {
        try {
            File thisFile = new File(aPath);

            return thisFile.list();

        } catch (Exception exp) {
            System.out.println("Error listing file names: " + exp);
        }
        return null;
    }

    public static String[] getFolderFileNames(URI aPathURI) {
        try {
            File thisFile = new File(aPathURI);

            return thisFile.list();

        } catch (Exception exp) {
            System.out.println("Error listing file names: " + exp);
        }
        return null;
    }
}