se.datadosen.io
Class LinkFile

java.lang.Object
  extended by java.io.File
      extended by se.datadosen.io.LinkFile
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<java.io.File>

public class LinkFile
extends java.io.File

Link (shortcut) support for JAlbum. A LinkFile represents a link to a file. It is a subclass of java.io.File. All methods on java.io.File but the getName(), renameTo(), compareTo, equals, hashCode and toString methods will operate on the target file (the file that the LinkFile links to). Use getTargetName() to get the name of the target file itself. Use getLink() to retrieve a File representing the link itself (which usually doesn't exists physically in the file system and usually doesn't have the same parent file as its target - It's parent is the album parent.)

Since:
7.0 With jAlbum 8.1.4, LinkFiles are only considered equal if they have the same abstract path name, not simply if they point to the same file.
See Also:
Serialized Form

Field Summary
protected  java.io.File link
           
protected  java.io.File target
           
 
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
 
Constructor Summary
LinkFile(java.io.File parent, java.lang.String name, java.io.File target)
           
 
Method Summary
 int compareTo(java.io.File other)
           
 boolean equals(java.lang.Object obj)
           
 java.io.File getLink()
           
 java.lang.String getName()
           
 java.io.File getTarget()
           
 java.lang.String getTargetName()
           
 int hashCode()
           
 boolean renameTargetTo(java.io.File dest)
           
 boolean renameTo(java.io.File dest)
          Simply return true.
 java.lang.String toString()
           
 
Methods inherited from class java.io.File
canExecute, canRead, canWrite, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toURI, toURL
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

link

protected java.io.File link

target

protected java.io.File target
Constructor Detail

LinkFile

public LinkFile(java.io.File parent,
                java.lang.String name,
                java.io.File target)
Method Detail

getName

public java.lang.String getName()
Overrides:
getName in class java.io.File

getTargetName

public java.lang.String getTargetName()

compareTo

public int compareTo(java.io.File other)
Specified by:
compareTo in interface java.lang.Comparable<java.io.File>
Overrides:
compareTo in class java.io.File

hashCode

public int hashCode()
Overrides:
hashCode in class java.io.File

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.io.File

renameTo

public boolean renameTo(java.io.File dest)
Simply return true. (There is no backing file to rename). It is the responsibility of the caller to maintain the name permanently.

Overrides:
renameTo in class java.io.File

renameTargetTo

public boolean renameTargetTo(java.io.File dest)

getLink

public java.io.File getLink()

getTarget

public java.io.File getTarget()

toString

public java.lang.String toString()
Overrides:
toString in class java.io.File