Code for getting the directory packaged code is running from


Details:

Little bit of code useful for finding file or layer names if you've got the full path.


Original author/s: Andy Evans
Original location/s:
Adapted by:
License: none


Imports and instance variables:

	// None


Code:

	String path = "c:\\temp\\layer\\buildings";
	String name = null;
	if (filePath.lastIndexOf("\\") > 0) {
		name = path.substring(path.lastIndexOf("\\") + 1);
	} else {
		name = path.substring(path.lastIndexOf("/") + 1);
	}
	// name is "buildings".