Java Path Create nio createSymlink(Path realFileLocation, Path softLinkLocation)

Here you can find the source of createSymlink(Path realFileLocation, Path softLinkLocation)

Description

create Symlink

License

Open Source License

Declaration

public static void createSymlink(Path realFileLocation, Path softLinkLocation) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.IOException;
import java.nio.file.Files;

import java.nio.file.Path;

public class Main {
    public static void createSymlink(Path realFileLocation, Path softLinkLocation) {
        try {//w  w  w  .  j  a v a2s.c  o m
            Files.createSymbolicLink(softLinkLocation, realFileLocation);
        } catch (IOException e) {
            System.err.println(e);
        } catch (UnsupportedOperationException e) {
            // Some file systems do not support symbolic links.
            System.err.println(e);
        }
    }
}

Related

  1. createRandomFolder(Path basePath)
  2. createRandomFolders(Path basePath, int numberOfFolders)
  3. createRelativePath(File baseDirFile, File file)
  4. createSourceFile(Path path, String... lines)
  5. createSymbolicLink(String linkPathString, String targetPathString)
  6. createSymlink(String targetPathStr, File symlinkFile)
  7. createTempDirectory(final String path, final String prefix)
  8. createTempDirectory(Path dir, String prefix)
  9. createTempFile(Path baseDir, String prefix, String suffix)