private static URL toURL(VirtualFile file) { try { return file.toURL(); } catch (Exception e) { throw new IllegalArgumentException("Invalid root file: " + file); } }
public DeploymentImpl(VirtualFile rootFile, String location, String symbolicName, Version version) { if (rootFile == null) throw new IllegalArgumentException("Null rootFile"); if (location == null) location = rootFile.getPathName(); if (symbolicName == null) symbolicName = rootFile.getName(); if (version == null) version = Version.emptyVersion; this.rootFile = rootFile; this.location = location; this.symbolicName = symbolicName; this.version = version.toString(); try { this.rootURL = rootFile.toURL(); } catch (IOException ex) { throw new IllegalStateException("Cannot obtain root URL", ex); } }