public class LinkUtils extends Object
LinkUtils class.
| Constructor and Description |
|---|
LinkUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
createHardLink(File linkTarget,
File linkFile)
Creates a hard link
|
static boolean |
createLink(File linkTarget,
File linkFile,
boolean symbolic)
Creates a link.
|
static boolean |
createLink(File linkTarget,
File linkFile,
LinkType linkType)
Creates a link
|
static boolean |
createSymbolicLink(File linkTarget,
File linkFile)
Creates a symbolik link
|
static File |
createTempFile(String prefix,
String suffix,
File parentDir)
Creates a temporary file
|
static void |
deleteSymbolicLink(File linkFile)
Deletes the symbolic link
|
static boolean |
isLink(File file)
Returns whether the given file is a link
|
boolean |
isSymbolicLink(File file)
Checks whether a given file is a symbolic link.
|
public static boolean isLink(@Nonnull File file) throws IOException
file - a File object.IOException - if any.public static boolean createLink(@Nonnull File linkTarget, @Nonnull File linkFile, @Nonnull LinkType linkType) throws IOException
linkTarget - the link sourcelinkFile - the link filelinkType - the type of linkIOException - if any.public static boolean createSymbolicLink(@Nonnull File linkTarget, @Nonnull File linkFile) throws IOException
linkTarget - the link sourcelinkFile - the link fileIOException - if any.public static boolean createHardLink(@Nonnull File linkTarget, @Nonnull File linkFile) throws IOException
linkTarget - the link sourcelinkFile - the link fileIOException - if any.public static boolean createLink(@Nonnull File linkTarget, @Nonnull File linkFile, boolean symbolic) throws IOException
linkTarget - the link sourcelinkFile - the link filesymbolic - whether to create a symbolic linkIOException - if something went wrongpublic static void deleteSymbolicLink(@Nonnull File linkFile) throws IOException
linkFile - the link fileIOException - if any.@Nonnull public static File createTempFile(@Nonnull String prefix, @Nonnull String suffix, @Nullable File parentDir)
prefix - the prefixsuffix - the suffixparentDir - the parent dirpublic boolean isSymbolicLink(@Nonnull File file) throws IOException
file - the fileIOException - if any.Copyright © 2012 cedarsoft GmbH. All Rights Reserved.