|
28 | 28 | import java.io.FileReader;
|
29 | 29 | import java.io.IOException;
|
30 | 30 | import java.io.InputStream;
|
| 31 | +import java.nio.file.Paths; |
31 | 32 | import java.util.ArrayList;
|
32 | 33 | import java.util.HashMap;
|
33 | 34 | import java.util.Map;
|
@@ -56,6 +57,8 @@ public class SCCSRepository extends Repository {
|
56 | 57 | */
|
57 | 58 | public static final String CMD_FALLBACK = "sccs";
|
58 | 59 |
|
| 60 | + private static final String CODEMGR_WSDATA = "Codemgr_wsdata"; |
| 61 | + |
59 | 62 | public SCCSRepository() {
|
60 | 63 | type = "SCCS";
|
61 | 64 | datePatterns = new String[]{
|
@@ -143,18 +146,18 @@ public void update() {
|
143 | 146 | public boolean fileHasHistory(File file) {
|
144 | 147 | String parentFile = file.getParent();
|
145 | 148 | String name = file.getName();
|
146 |
| - File f = new File(parentFile + "/SCCS/s." + name); |
| 149 | + File f = Paths.get(parentFile, "SCCS", "s." + name).toFile(); |
147 | 150 | return f.exists();
|
148 | 151 | }
|
149 | 152 |
|
150 | 153 | @Override
|
151 | 154 | boolean isRepositoryFor(File file, boolean interactive) {
|
152 | 155 | if (file.isDirectory()) {
|
153 |
| - File f = new File(file, "codemgr_wsdata"); |
| 156 | + File f = new File(file, CODEMGR_WSDATA.toLowerCase()); |
154 | 157 | if (f.isDirectory()) {
|
155 | 158 | return true;
|
156 | 159 | }
|
157 |
| - f = new File(file, "Codemgr_wsdata"); |
| 160 | + f = new File(file, CODEMGR_WSDATA); |
158 | 161 | if (f.isDirectory()) {
|
159 | 162 | return true;
|
160 | 163 | }
|
@@ -187,8 +190,7 @@ History getHistory(File file) throws HistoryException {
|
187 | 190 |
|
188 | 191 | @Override
|
189 | 192 | String determineParent(boolean interactive) throws IOException {
|
190 |
| - File parentFile = new File(getDirectoryName() + File.separator |
191 |
| - + "Codemgr_wsdata" + File.separator + "parent"); |
| 193 | + File parentFile = Paths.get(getDirectoryName(), CODEMGR_WSDATA, "parent").toFile(); |
192 | 194 | String parent = null;
|
193 | 195 |
|
194 | 196 | if (parentFile.isFile()) {
|
|
0 commit comments