File tree Expand file tree Collapse file tree 3 files changed +5
-6
lines changed Expand file tree Collapse file tree 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 {
2424
2525case class PackageName (dottedString : String ) {
2626 def isRoot : Boolean = dottedString.isEmpty
27- val dirPathTrailingSlash : String = FileUtils .dirPathInArchive (dottedString) + " / "
27+ val dirPathTrailingSlash : String = FileUtils .dirPath (dottedString) + JFile .separatorChar
2828
2929 def entryName (entry : String ): String = {
3030 if (isRoot) entry else {
Original file line number Diff line number Diff line change @@ -42,10 +42,9 @@ object FileUtils {
4242 else if (endsJava(fileName)) stripJavaExtension(fileName)
4343 else throw new FatalError (" Unexpected source file ending: " + fileName)
4444
45+ /** Returns the relative directory path with `/` as separator */
4546 def dirPath (forPackage : String ): String = forPackage.replace('.' , JFile .separatorChar)
4647
47- def dirPathInArchive (forPackage : String ): String = forPackage.replace('.' , '/' )
48-
4948 def endsClass (fileName : String ): Boolean =
5049 fileName.length > 6 && fileName.substring(fileName.length - 6 ) == " .class"
5150
Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ object ZipArchive {
3838 private def dirName (path : String ) = splitPath(path, front = true )
3939 private def baseName (path : String ) = splitPath(path, front = false )
4040 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
4242 val path = if (isDir) path0.substring(0 , path0.length - 1 ) else path0
43- val idx = path.lastIndexOf('/' )
43+ val idx = path.lastIndexOf(JFile .separatorChar )
4444
4545 if (idx < 0 )
46- if (front) " / "
46+ if (front) JFile .separator
4747 else path
4848 else
4949 if (front) path.substring(0 , idx + 1 )
You can’t perform that action at this time.
0 commit comments