@Override public void execute() throws Exception { if (!FileUtil.symlinksSupported()) { return; // no symbolic links on Windows } File inFolder = pickFolder(3121); File symlinkFile = new File(inFolder + "/newFile-" + Math.random()); log(this, symlinkFile.getAbsolutePath()); FileUtil.createSymlink("/does/not/exist", symlinkFile); }
@Override public void execute() throws Exception { if (!FileUtil.symlinksSupported()) { return; // no symbolic links on Windows } File symlinkFile = pickFileOrFolder( 2121, new FileFilter() { @Override public boolean accept(File file) { return FileUtil.isSymlink(file); } }); log(this, symlinkFile.getAbsolutePath()); symlinkFile.delete(); FileUtil.createSymlink("/does/not/exist/" + Math.random(), symlinkFile); }