1 package org.jetbrains.jps.incremental;
3 import com.intellij.openapi.util.Key;
4 import com.intellij.openapi.util.io.FileUtil;
8 import java.net.URISyntaxException;
9 import java.util.Locale;
13 * @author Eugene Zhuravlev
17 private static final Paths ourInstance = new Paths();
18 public static final Key<Set<String>> CHUNK_REMOVED_SOURCES_KEY = Key.create("_chunk_removed_sources_");
19 private volatile File mySystemRoot = new File(System.getProperty("user.home", ".jps-server"));
24 public static Paths getInstance() {
28 public static File getSystemRoot() {
29 return getInstance().mySystemRoot;
32 public void setSystemRoot(File systemRoot) {
33 mySystemRoot = systemRoot;
36 public static File getDataStorageRoot(String projectName) {
37 return new File(getInstance().mySystemRoot, projectName.toLowerCase(Locale.US));
40 public static URI toURI(String localPath) {
42 String p = FileUtil.toSystemIndependentName(localPath);
43 if (!p.startsWith("/")) {
46 if (p.startsWith("//")) {
49 return new URI("file", null, p.replaceAll(" ", "%20"), null);
51 catch (URISyntaxException e) {
56 public static File convertToFile(final URI uri) {
57 return new File(toURI(uri.getPath()));