Skip to content

Commit

Permalink
Fix issues with paths in Windows.
Browse files Browse the repository at this point in the history
Fix #15
  • Loading branch information
VolkerHartmann committed Mar 22, 2022
1 parent 3f19afb commit 3d82d73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

## [1.0.1] - 2022-03-22

### Fixed
- Fix issue with path. (Windows) (issue #15)

## [1.0.0] - 2022-03-11

### Fixed
Expand Down Expand Up @@ -85,7 +90,8 @@ Extracted from the 'base-repo' project.
### Removed
- none

[Unreleased]: https://github.com/kit-data-manager/repo-core/compare/v1.0.0...HEAD
[Unreleased]: https://github.com/kit-data-manager/repo-core/compare/v1.0.1...HEAD
[1.0.1]: https://github.com/kit-data-manager/repo-core/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/kit-data-manager/repo-core/compare/v0.9.2...v1.0.0
[0.9.2]: https://github.com/kit-data-manager/repo-core/compare/v0.9.1...v0.9.2
[0.9.1]: https://github.com/kit-data-manager/repo-core/compare/v0.9.0...v0.9.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public String createPath(DataResource resource) {
for (int index = 0; index < depth; index++) {
pathElements[index] = createPathToRecord[index];
}
String pattern = Paths.get(File.separator, pathElements).toString();

if (pattern.startsWith(File.separator)) {
pattern = pattern.substring(1);
String localDir = "." + File.separator;
String pattern = Paths.get(localDir, pathElements).toString();
if (pattern.startsWith(localDir)) {
pattern = pattern.substring(localDir.length());
}

return pattern;
Expand Down

0 comments on commit 3d82d73

Please sign in to comment.