Android Utililty Methods File Link Check

List of utility methods to do File Link Check


The list of methods to do File Link Check are organized into topic(s).


booleanisSymbolicLink(File parent, String name)
is Symbolic Link
if (parent == null) {
    File f = new File(name);
    parent = f.getParentFile();
    name = f.getName();
File toTest = new File(parent.getCanonicalPath(), name);
return !toTest.getAbsolutePath().equals(toTest.getCanonicalPath());
booleanisSymlink(File file)
is Symlink
if (file == null)
    throw new NullPointerException("File must not be null");
File canon;
if (file.getParent() == null) {
    canon = file;
} else {
    File canonDir = file.getParentFile().getCanonicalFile();
    canon = new File(canonDir, file.getName());