// VERY basic shortcut detection:
boolean isShortcut = !selectedFile.toURI().getPath().endsWith("/");
if (selectedFile.isDirectory() && !isShortcut) {
newResource = new DirectoryProfileResource(selectedFile, recursive);
} else {
newResource = new FileProfileResource(selectedFile);
}
if (profile.addResource(newResource)) {
ProfileResourceNode primordialNode = new ProfileResourceNode(newResource.getUri());
final NodeMetaData metaData = primordialNode.getMetaData();