List of usage examples for org.apache.commons.vfs FileSystem addJunction
void addJunction(String junctionPoint, FileObject targetFile) throws FileSystemException;
From source file:org.jboss.dashboard.filesystem.BinariesMapping.java
public void addToVirtualFilesystem(FileSystem fileSystem) throws FileSystemException { if (!isWebappDirectoryRelative()) { FileObject file = VfsWrapper.getManager() .resolveFile(getSchema() + "://" + StringUtils.defaultString(getJunctionUrl())); file.createFolder(); //ensure it exists fileSystem.addJunction(getJunctionPoint(), file); } else {/*from w ww .j a v a2 s. co m*/ File parentFile = new File(Application.lookup().getBaseAppDirectory()); String junctionUrl = getJunctionUrl(); while (junctionUrl.startsWith("../")) { junctionUrl = junctionUrl.substring(3); parentFile = parentFile.getParentFile(); } FileObject file = VfsWrapper.getManager().resolveFile(getSchema() + "://" + parentFile + (StringUtils.isEmpty(junctionUrl) ? "" : ("/" + junctionUrl))); file.createFolder(); //ensure it exists fileSystem.addJunction(getJunctionPoint(), file); } }