Java Utililty Methods Is Symbolic Link

List of utility methods to do Is Symbolic Link

Description

The list of methods to do Is Symbolic Link are organized into topic(s).

Method

booleanisSymbolicLink(File file)
Determines if a file is a symbolic link.
if (file == null) {
    throw new NullPointerException("File must not be null");
File fileInCanonicalDir = null;
if (file.getParent() == null) {
    fileInCanonicalDir = file;
} else {
    File canonicalDir = file.getParentFile().getCanonicalFile();
...
booleanisSymbolicLink(File file)
is Symbolic Link
try {
    final File canonicalFile = file.getCanonicalFile();
    final File absoluteFile = file.getAbsoluteFile();
    final File parentFile = file.getParentFile();
    return !canonicalFile.getName().equals(absoluteFile.getName()) ||
            parentFile != null && !parentFile.getCanonicalPath().equals(canonicalFile.getParent());
} catch (IOException e) {
    return true;
...
booleanisSymbolicLink(File file)
is Symbolic Link
return !file.getAbsolutePath().equals(file.getCanonicalPath());
booleanisSymbolicLink(File file)
is Symbolic Link
try {
    File parent = file.getParentFile();
    String name = file.getName();
    File toTest = parent != null ? new File(parent.getCanonicalPath(), name) : new File(name);
    return !toTest.getAbsolutePath().equals(toTest.getCanonicalPath());
} catch (Exception e) {
    return false;
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 base, File curious)
Check if a file relative to a base path has a symlink, not counting any symlinks in base or above.
if (base == null) {
    throw new NullPointerException("Base file must not be null");
if (curious == null) {
    throw new NullPointerException("Curious file must not be null");
File baseCanonical = base.getCanonicalFile();
File curiousResolved = new File(baseCanonical, curious.getPath());
...
booleanisSymLink(File file)
is Sym Link
return !file.getAbsolutePath().equals(file.getCanonicalPath());
booleanisSymlink(File file)
is Symlink
String baseName = file.getName();
String canonicalPathExceptBaseName = new File(file.getParentFile().getCanonicalFile(), baseName).getPath();
return !file.getCanonicalPath().equals(canonicalPathExceptBaseName);
booleanisSymlink(File file)
is Symlink
if (file == null) {
    throw new NullPointerException("File must not be null");
if (isSystemWindows()) {
    return false;
File fileInCanonicalDir = null;
if (file.getParent() == null) {
...
booleanisSymlink(File file)
Determines whether the specified file is a Symbolic Link rather than an actual file.
if (file == null) {
    throw new NullPointerException("File must not be null");
if (isSystemWindows()) {
    return false;
File fileInCanonicalDir = null;
if (file.getParent() == null) {
...