File tree 3 files changed +5
-6
lines changed
3 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ trait SourceFileEntry extends ClassRepresentation {
24
24
25
25
case class PackageName (dottedString : String ) {
26
26
def isRoot : Boolean = dottedString.isEmpty
27
- val dirPathTrailingSlash : String = FileUtils .dirPathInArchive (dottedString) + " / "
27
+ val dirPathTrailingSlash : String = FileUtils .dirPath (dottedString) + JFile .separatorChar
28
28
29
29
def entryName (entry : String ): String = {
30
30
if (isRoot) entry else {
Original file line number Diff line number Diff line change @@ -42,10 +42,9 @@ object FileUtils {
42
42
else if (endsJava(fileName)) stripJavaExtension(fileName)
43
43
else throw new FatalError (" Unexpected source file ending: " + fileName)
44
44
45
+ /** Returns the relative directory path with `/` as separator */
45
46
def dirPath (forPackage : String ): String = forPackage.replace('.' , JFile .separatorChar)
46
47
47
- def dirPathInArchive (forPackage : String ): String = forPackage.replace('.' , '/' )
48
-
49
48
def endsClass (fileName : String ): Boolean =
50
49
fileName.length > 6 && fileName.substring(fileName.length - 6 ) == " .class"
51
50
Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ object ZipArchive {
38
38
private def dirName (path : String ) = splitPath(path, front = true )
39
39
private def baseName (path : String ) = splitPath(path, front = false )
40
40
private def splitPath (path0 : String , front : Boolean ): String = {
41
- val isDir = path0.charAt(path0.length - 1 ) == '/'
41
+ val isDir = path0.charAt(path0.length - 1 ) == JFile .separatorChar
42
42
val path = if (isDir) path0.substring(0 , path0.length - 1 ) else path0
43
- val idx = path.lastIndexOf('/' )
43
+ val idx = path.lastIndexOf(JFile .separatorChar )
44
44
45
45
if (idx < 0 )
46
- if (front) " / "
46
+ if (front) JFile .separator
47
47
else path
48
48
else
49
49
if (front) path.substring(0 , idx + 1 )
You can’t perform that action at this time.
0 commit comments