List of usage examples for org.springframework.core.io FileSystemResource getPath
public final String getPath()
From source file:com.wavemaker.tools.project.LocalStudioFileSystem.java
@Override public Resource createPath(Resource resource, String path) { Assert.isInstanceOf(FileSystemResource.class, resource, "Expected a FileSystemResource"); try {//from w w w . java2 s . co m if (!resource.exists()) { File rootFile = resource.getFile(); while (rootFile.getAbsolutePath().length() > 1 && !rootFile.exists()) { rootFile = rootFile.getParentFile(); } IOUtils.makeDirectories(resource.getFile(), rootFile); } FileSystemResource relativeResource = (FileSystemResource) resource.createRelative(path); if (!relativeResource.exists()) { if (relativeResource.getPath().endsWith("/")) { IOUtils.makeDirectories(relativeResource.getFile(), resource.getFile()); } else { IOUtils.makeDirectories(relativeResource.getFile().getParentFile(), resource.getFile()); } } return relativeResource; } catch (IOException ex) { throw new WMRuntimeException(ex); } }