public class HardLink extends Object
Modifier and Type | Class and Description |
---|---|
static class |
HardLink.LinkStats
HardLink statistics counters and methods.
|
Modifier and Type | Field and Description |
---|---|
HardLink.LinkStats |
linkStats |
Constructor and Description |
---|
HardLink() |
Modifier and Type | Method and Description |
---|---|
static void |
createHardLink(File file,
File linkName)
Creates a hardlink
|
static void |
createHardLinkMult(File parentDir,
String[] fileBaseNames,
File linkDir)
Creates hardlinks from multiple existing files within one parent
directory, into one target directory.
|
static int |
getLinkCount(File fileName)
Retrieves the number of links to the specified file.
|
public final HardLink.LinkStats linkStats
public HardLink()
public static void createHardLink(File file, File linkName) throws IOException
file
- - existing source filelinkName
- - desired target link fileIOException
public static void createHardLinkMult(File parentDir, String[] fileBaseNames, File linkDir) throws IOException
parentDir
- - directory containing source filesfileBaseNames
- - list of path-less file names, as returned by
parentDir.list()linkDir
- - where the hardlinks should be put. It must already exist.IOException
public static int getLinkCount(File fileName) throws IOException
IOException
Copyright © 2017 Apache Software Foundation. All Rights Reserved.