-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
emmanue1
committed
May 31, 2019
1 parent
db6ba80
commit b4b8ec8
Showing
14 changed files
with
86 additions
and
74 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
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
40 changes: 0 additions & 40 deletions
40
.../main/java/org/jd/gui/service/container/JmodClassesDirectoryContainerFactoryProvider.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
services/src/main/java/org/jd/gui/service/container/JmodContainerFactoryProvider.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,43 @@ | ||
/* | ||
* Copyright (c) 2008-2019 Emmanuel Dupuy. | ||
* This project is distributed under the GPLv3 license. | ||
* This is a Copyleft license that gives the user the right to use, | ||
* copy and modify the code freely for non-commercial purposes. | ||
*/ | ||
|
||
package org.jd.gui.service.container; | ||
|
||
import org.jd.gui.api.API; | ||
import org.jd.gui.api.model.Container; | ||
import org.jd.gui.model.container.JmodContainer; | ||
import org.jd.gui.spi.ContainerFactory; | ||
import org.jd.gui.util.exception.ExceptionUtil; | ||
|
||
import java.nio.file.Files; | ||
import java.nio.file.InvalidPathException; | ||
import java.nio.file.Path; | ||
|
||
public class JmodContainerFactoryProvider implements ContainerFactory { | ||
@Override | ||
public String getType() { return "jmod"; } | ||
|
||
@Override | ||
public boolean accept(API api, Path rootPath) { | ||
if (rootPath.toUri().toString().toLowerCase().endsWith(".jmod!/")) { | ||
return true; | ||
} else { | ||
// Extension: accept uncompressed WAR file containing a folder 'WEB-INF' | ||
try { | ||
return rootPath.getFileSystem().provider().getScheme().equals("file") && Files.exists(rootPath.resolve("classes")); | ||
} catch (InvalidPathException e) { | ||
assert ExceptionUtil.printStackTrace(e); | ||
return false; | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public Container make(API api, Container.Entry parentEntry, Path rootPath) { | ||
return new JmodContainer(api, parentEntry, rootPath); | ||
} | ||
} |
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
24 changes: 24 additions & 0 deletions
24
services/src/main/java/org/jd/gui/service/treenode/JmodPackageTreeNodeFactoryProvider.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,24 @@ | ||
/* | ||
* Copyright (c) 2008-2019 Emmanuel Dupuy. | ||
* This project is distributed under the GPLv3 license. | ||
* This is a Copyleft license that gives the user the right to use, | ||
* copy and modify the code freely for non-commercial purposes. | ||
*/ | ||
|
||
package org.jd.gui.service.treenode; | ||
|
||
import java.util.regex.Pattern; | ||
|
||
public class JmodPackageTreeNodeFactoryProvider extends PackageTreeNodeFactoryProvider { | ||
|
||
@Override public String[] getSelectors() { return appendSelectors("jmod:dir:*"); } | ||
|
||
@Override | ||
public Pattern getPathPattern() { | ||
if (externalPathPattern == null) { | ||
return Pattern.compile("classes\\/.*"); | ||
} else { | ||
return externalPathPattern; | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
services/src/main/resources/META-INF/services/org.jd.gui.spi.ContainerFactory
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