We are about to switch to a new forum software. Until then we have removed the registration on this forum.
While using selectInput() method, I can retrieve the file path but I dont know how to get the folder path in which that file is residing.
what I mean is, I have this
I have tried to do this but it didn't work
String path = selection.getAbsolutePath();
println(path.length ());
for (int i=0; i<path.length (); i++) {
if ( path.charAt(path.length()-1)!= '\"' ) {
path = path.substring( 0, path.length()-1 );
println(i +" : "+ path);
} else {
println("found");
break;
}
}
Answers
Perhaps File's getParent() method can get ya the folder only: :-?
http://docs.oracle.com/javase/8/docs/api/java/io/File.html#getParent--