forked from eclipse-lemminx/lemminx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Schema cache directory should be configurable
Fixes eclipse-lemminx#222 Signed-off-by: Nikolas Komonen <[email protected]>
- Loading branch information
1 parent
6063992
commit fce3b66
Showing
7 changed files
with
217 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
org.eclipse.lsp4xml/src/main/java/org/eclipse/lsp4xml/settings/ServerSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2019 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
package org.eclipse.lsp4xml.settings; | ||
|
||
import org.eclipse.lsp4xml.utils.JSONUtility; | ||
|
||
/** | ||
* ServerSettings | ||
*/ | ||
public class ServerSettings { | ||
|
||
private String workDir; | ||
|
||
|
||
/** | ||
* @return the workDir | ||
*/ | ||
public String getWorkDir() { | ||
return workDir; | ||
} | ||
|
||
/** | ||
* @param workDir the workDir to set | ||
*/ | ||
public void setWorkDir(String workDir) { | ||
this.workDir = workDir; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
org.eclipse.lsp4xml/src/test/java/org/eclipse/lsp4xml/utils/FilesUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2019 Red Hat Inc. and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Red Hat Inc. - initial API and implementation | ||
*******************************************************************************/ | ||
|
||
|
||
package org.eclipse.lsp4xml.utils; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
import org.junit.Test; | ||
|
||
/** | ||
* FilesUtilsTest | ||
*/ | ||
public class FilesUtilsTest { | ||
|
||
@Test | ||
public void testFilesCachePathPreference() throws Exception { | ||
System.clearProperty(FilesUtils.LSP4XML_WORKDIR_KEY); | ||
String newBasePathString = System.getProperty("user.home"); | ||
String newSubPathString = "New/Sub/Path"; | ||
Path newSubPath = Paths.get(newSubPathString); | ||
FilesUtils.setCachePathSetting(newBasePathString); | ||
Path finalPath = FilesUtils.getDeployedPath(newSubPath); | ||
assertEquals(newBasePathString + "/" + newSubPathString, finalPath.toString()); | ||
} | ||
} |