Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.io.File;

public class Main {
    public static int getDepth(File file) {
        if (file.getParent() == null || new File(file.getParent()).getPath().equals(new File(file.getPath())))
            return 1;
        return 1 + getDepth(new File(file.getParent()));
    }
}