Browse Source

Merge pull request #47 from lightglitch/master

Editor config style applied
pull/48/head
Decebal Suiu 10 years ago
parent
commit
d7cf10f7aa
  1. 6
      demo/api/pom.xml
  2. 6
      demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java
  3. 2
      demo/app/src/main/assembly/assembly.xml
  4. 186
      demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java
  5. 2
      demo/plugins/disabled.txt
  6. 2
      demo/plugins/enabled.txt
  7. 12
      demo/plugins/plugin1/pom.xml
  8. 2
      demo/plugins/plugin1/src/main/assembly/assembly.xml
  9. 6
      demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java
  10. 10
      demo/plugins/plugin2/pom.xml
  11. 2
      demo/plugins/plugin2/src/main/assembly/assembly.xml
  12. 6
      demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java
  13. 8
      demo/plugins/pom.xml
  14. 2
      demo/pom.xml
  15. 6
      demo_gradle/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java
  16. 192
      demo_gradle/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java
  17. 2
      demo_gradle/plugins/disabled.txt
  18. 2
      demo_gradle/plugins/enabled.txt
  19. 6
      demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java
  20. 2
      pf4j/src/main/java/ro/fortsoft/pf4j/CompoundPluginRepository.java
  21. 8
      pf4j/src/main/java/ro/fortsoft/pf4j/CyclicDependencyException.java
  22. 12
      pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginDescriptorFinder.java
  23. 2
      pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginRepository.java
  24. 2
      pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginStatusProvider.java
  25. 8
      pf4j/src/main/java/ro/fortsoft/pf4j/DependencyResolver.java
  26. 12
      pf4j/src/main/java/ro/fortsoft/pf4j/DevelopmentPluginClasspath.java
  27. 8
      pf4j/src/main/java/ro/fortsoft/pf4j/Extension.java
  28. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/ExtensionPoint.java
  29. 2
      pf4j/src/main/java/ro/fortsoft/pf4j/ExtensionWrapper.java
  30. 36
      pf4j/src/main/java/ro/fortsoft/pf4j/ExtensionsIndexer.java
  31. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/Plugin.java
  32. 10
      pf4j/src/main/java/ro/fortsoft/pf4j/PluginDescriptorFinder.java
  33. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/PluginException.java
  34. 10
      pf4j/src/main/java/ro/fortsoft/pf4j/PluginNotFoundException.java
  35. 2
      pf4j/src/main/java/ro/fortsoft/pf4j/PluginRepository.java
  36. 2
      pf4j/src/main/java/ro/fortsoft/pf4j/PluginStatusProvider.java
  37. 24
      pf4j/src/main/java/ro/fortsoft/pf4j/RuntimeMode.java
  38. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/util/AndFileFilter.java
  39. 342
      pf4j/src/main/java/ro/fortsoft/pf4j/util/DirectedGraph.java
  40. 8
      pf4j/src/main/java/ro/fortsoft/pf4j/util/DirectoryFileFilter.java
  41. 8
      pf4j/src/main/java/ro/fortsoft/pf4j/util/ExtensionFileFilter.java
  42. 8
      pf4j/src/main/java/ro/fortsoft/pf4j/util/HiddenFilter.java
  43. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/util/JarFileFilter.java
  44. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/util/NotFileFilter.java
  45. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/util/StringUtils.java
  46. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/util/Unzip.java
  47. 6
      pf4j/src/main/java/ro/fortsoft/pf4j/util/ZipFileFilter.java

6
demo/api/pom.xml

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>ro.fortsoft.pf4j.demo</groupId> <groupId>ro.fortsoft.pf4j.demo</groupId>
<artifactId>pf4j-demo-parent</artifactId> <artifactId>pf4j-demo-parent</artifactId>
@ -23,7 +23,7 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>ro.fortsoft.pf4j</groupId> <groupId>ro.fortsoft.pf4j</groupId>
@ -32,5 +32,5 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

6
demo/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

2
demo/app/src/main/assembly/assembly.xml

@ -1,6 +1,6 @@
<!-- <!--
Describes the dist Describes the dist
@author Decebal Suiu @author Decebal Suiu
@version 1.0 @version 1.0
--> -->

186
demo/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java

@ -1,93 +1,93 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
*/ */
package ro.fortsoft.pf4j.demo; package ro.fortsoft.pf4j.demo;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import ro.fortsoft.pf4j.DefaultPluginManager; import ro.fortsoft.pf4j.DefaultPluginManager;
import ro.fortsoft.pf4j.PluginManager; import ro.fortsoft.pf4j.PluginManager;
import ro.fortsoft.pf4j.PluginWrapper; import ro.fortsoft.pf4j.PluginWrapper;
import ro.fortsoft.pf4j.demo.api.Greeting; import ro.fortsoft.pf4j.demo.api.Greeting;
/** /**
* A boot class that start the demo. * A boot class that start the demo.
* *
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public class Boot { public class Boot {
public static void main(String[] args) { public static void main(String[] args) {
// print logo // print logo
printLogo(); printLogo();
// create the plugin manager // create the plugin manager
final PluginManager pluginManager = new DefaultPluginManager(); final PluginManager pluginManager = new DefaultPluginManager();
// load the plugins // load the plugins
pluginManager.loadPlugins(); pluginManager.loadPlugins();
// enable a disabled plugin // enable a disabled plugin
// pluginManager.enablePlugin("welcome-plugin"); // pluginManager.enablePlugin("welcome-plugin");
// start (active/resolved) the plugins // start (active/resolved) the plugins
pluginManager.startPlugins(); pluginManager.startPlugins();
// retrieves the extensions for Greeting extension point // retrieves the extensions for Greeting extension point
List<Greeting> greetings = pluginManager.getExtensions(Greeting.class); List<Greeting> greetings = pluginManager.getExtensions(Greeting.class);
System.out.println(String.format("Found %d extensions for extension point '%s'", greetings.size(), Greeting.class.getName())); System.out.println(String.format("Found %d extensions for extension point '%s'", greetings.size(), Greeting.class.getName()));
for (Greeting greeting : greetings) { for (Greeting greeting : greetings) {
System.out.println(">>> " + greeting.getGreeting()); System.out.println(">>> " + greeting.getGreeting());
} }
// print extensions from classpath (non plugin) // print extensions from classpath (non plugin)
System.out.println(String.format("Extensions added by classpath:")); System.out.println(String.format("Extensions added by classpath:"));
Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null); Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null);
for (String extension : extensionClassNames) { for (String extension : extensionClassNames) {
System.out.println(" " + extension); System.out.println(" " + extension);
} }
// print extensions for each started plugin // print extensions for each started plugin
List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins(); List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins();
for (PluginWrapper plugin : startedPlugins) { for (PluginWrapper plugin : startedPlugins) {
String pluginId = plugin.getDescriptor().getPluginId(); String pluginId = plugin.getDescriptor().getPluginId();
System.out.println(String.format("Extensions added by plugin '%s':", pluginId)); System.out.println(String.format("Extensions added by plugin '%s':", pluginId));
extensionClassNames = pluginManager.getExtensionClassNames(pluginId); extensionClassNames = pluginManager.getExtensionClassNames(pluginId);
for (String extension : extensionClassNames) { for (String extension : extensionClassNames) {
System.out.println(" " + extension); System.out.println(" " + extension);
} }
} }
// stop the plugins // stop the plugins
pluginManager.stopPlugins(); pluginManager.stopPlugins();
/* /*
Runtime.getRuntime().addShutdownHook(new Thread() { Runtime.getRuntime().addShutdownHook(new Thread() {
@Override @Override
public void run() { public void run() {
pluginManager.stopPlugins(); pluginManager.stopPlugins();
} }
}); });
*/ */
} }
private static void printLogo() { private static void printLogo() {
System.out.println(StringUtils.repeat("#", 40)); System.out.println(StringUtils.repeat("#", 40));
System.out.println(StringUtils.center("PF4J-DEMO", 40)); System.out.println(StringUtils.center("PF4J-DEMO", 40));
System.out.println(StringUtils.repeat("#", 40)); System.out.println(StringUtils.repeat("#", 40));
} }
} }

2
demo/plugins/disabled.txt

@ -3,4 +3,4 @@
# - add one plugin id on each line # - add one plugin id on each line
# - put this file in plugins folder # - put this file in plugins folder
######################################## ########################################
#welcome-plugin #welcome-plugin

2
demo/plugins/enabled.txt

@ -3,4 +3,4 @@
# - add one plugin id on each line # - add one plugin id on each line
# - put this file in plugins folder # - put this file in plugins folder
######################################## ########################################
#welcome-plugin #welcome-plugin

12
demo/plugins/plugin1/pom.xml

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>ro.fortsoft.pf4j.demo</groupId> <groupId>ro.fortsoft.pf4j.demo</groupId>
<artifactId>pf4j-demo-plugins</artifactId> <artifactId>pf4j-demo-plugins</artifactId>
@ -19,7 +19,7 @@
<plugin.version>0.0.1</plugin.version> <plugin.version>0.0.1</plugin.version>
<plugin.provider>Decebal Suiu</plugin.provider> <plugin.provider>Decebal Suiu</plugin.provider>
<plugin.dependencies /> <plugin.dependencies />
</properties> </properties>
<build> <build>
<plugins> <plugins>
@ -43,7 +43,7 @@
</executions> </executions>
</plugin> </plugin>
--> -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
@ -63,7 +63,7 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version> <version>2.3</version>
@ -110,7 +110,7 @@
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
@ -119,5 +119,5 @@
<version>2.6</version> <version>2.6</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

2
demo/plugins/plugin1/src/main/assembly/assembly.xml

@ -1,6 +1,6 @@
<!-- <!--
Describes the plugin archive Describes the plugin archive
@author Decebal Suiu @author Decebal Suiu
@version 1.0 @version 1.0
--> -->

6
demo/plugins/plugin1/src/main/java/ro/fortsoft/pf4j/demo/welcome/WelcomePlugin.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

10
demo/plugins/plugin2/pom.xml

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>ro.fortsoft.pf4j.demo</groupId> <groupId>ro.fortsoft.pf4j.demo</groupId>
<artifactId>pf4j-demo-plugins</artifactId> <artifactId>pf4j-demo-plugins</artifactId>
@ -19,7 +19,7 @@
<plugin.version>0.0.1</plugin.version> <plugin.version>0.0.1</plugin.version>
<plugin.provider>Decebal Suiu</plugin.provider> <plugin.provider>Decebal Suiu</plugin.provider>
<plugin.dependencies /> <plugin.dependencies />
</properties> </properties>
<build> <build>
<plugins> <plugins>
@ -43,7 +43,7 @@
</executions> </executions>
</plugin> </plugin>
--> -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId> <artifactId>maven-antrun-plugin</artifactId>
@ -63,7 +63,7 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version> <version>2.3</version>
@ -110,6 +110,6 @@
</configuration> </configuration>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

2
demo/plugins/plugin2/src/main/assembly/assembly.xml

@ -1,6 +1,6 @@
<!-- <!--
Describes the plugin archive Describes the plugin archive
@author Decebal Suiu @author Decebal Suiu
@version 1.0 @version 1.0
--> -->

6
demo/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

8
demo/plugins/pom.xml

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>ro.fortsoft.pf4j.demo</groupId> <groupId>ro.fortsoft.pf4j.demo</groupId>
<artifactId>pf4j-demo-parent</artifactId> <artifactId>pf4j-demo-parent</artifactId>
@ -27,7 +27,7 @@
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
@ -93,7 +93,7 @@
<artifactId>pf4j</artifactId> <artifactId>pf4j</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>ro.fortsoft.pf4j.demo</groupId> <groupId>ro.fortsoft.pf4j.demo</groupId>
@ -102,5 +102,5 @@
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

2
demo/pom.xml

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<groupId>ro.fortsoft.pf4j</groupId> <groupId>ro.fortsoft.pf4j</groupId>
<artifactId>pf4j-parent</artifactId> <artifactId>pf4j-parent</artifactId>

6
demo_gradle/api/src/main/java/ro/fortsoft/pf4j/demo/api/Greeting.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

192
demo_gradle/app/src/main/java/ro/fortsoft/pf4j/demo/Boot.java

@ -1,96 +1,96 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
*/ */
package ro.fortsoft.pf4j.demo; package ro.fortsoft.pf4j.demo;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import ro.fortsoft.pf4j.DefaultPluginManager; import ro.fortsoft.pf4j.DefaultPluginManager;
import ro.fortsoft.pf4j.PluginManager; import ro.fortsoft.pf4j.PluginManager;
import ro.fortsoft.pf4j.PluginWrapper; import ro.fortsoft.pf4j.PluginWrapper;
import ro.fortsoft.pf4j.demo.api.Greeting; import ro.fortsoft.pf4j.demo.api.Greeting;
/** /**
* A boot class that start the demo. * A boot class that start the demo.
* *
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public class Boot { public class Boot {
public static void main(String[] args) { public static void main(String[] args) {
// print logo // print logo
printLogo(); printLogo();
// create the plugin manager // create the plugin manager
final PluginManager pluginManager = new DefaultPluginManager(); final PluginManager pluginManager = new DefaultPluginManager();
// load the plugins // load the plugins
pluginManager.loadPlugins(); pluginManager.loadPlugins();
// enable a disabled plugin // enable a disabled plugin
// pluginManager.enablePlugin("welcome-plugin"); // pluginManager.enablePlugin("welcome-plugin");
// start (active/resolved) the plugins // start (active/resolved) the plugins
pluginManager.startPlugins(); pluginManager.startPlugins();
System.out.println("Plugindirectory: "); System.out.println("Plugindirectory: ");
System.out.println("\t" + System.getProperty("pf4j.pluginsDir", "plugins") + "\n"); System.out.println("\t" + System.getProperty("pf4j.pluginsDir", "plugins") + "\n");
// retrieves the extensions for Greeting extension point // retrieves the extensions for Greeting extension point
List<Greeting> greetings = pluginManager.getExtensions(Greeting.class); List<Greeting> greetings = pluginManager.getExtensions(Greeting.class);
System.out.println(String.format("Found %d extensions for extension point '%s'", greetings.size(), Greeting.class.getName())); System.out.println(String.format("Found %d extensions for extension point '%s'", greetings.size(), Greeting.class.getName()));
for (Greeting greeting : greetings) { for (Greeting greeting : greetings) {
System.out.println(">>> " + greeting.getGreeting()); System.out.println(">>> " + greeting.getGreeting());
} }
// // print extensions from classpath (non plugin) // // print extensions from classpath (non plugin)
// System.out.println(String.format("Extensions added by classpath:")); // System.out.println(String.format("Extensions added by classpath:"));
// Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null); // Set<String> extensionClassNames = pluginManager.getExtensionClassNames(null);
// for (String extension : extensionClassNames) { // for (String extension : extensionClassNames) {
// System.out.println(" " + extension); // System.out.println(" " + extension);
// } // }
// print extensions for each started plugin // print extensions for each started plugin
List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins(); List<PluginWrapper> startedPlugins = pluginManager.getStartedPlugins();
for (PluginWrapper plugin : startedPlugins) { for (PluginWrapper plugin : startedPlugins) {
String pluginId = plugin.getDescriptor().getPluginId(); String pluginId = plugin.getDescriptor().getPluginId();
System.out.println(String.format("Extensions added by plugin '%s':", pluginId)); System.out.println(String.format("Extensions added by plugin '%s':", pluginId));
// extensionClassNames = pluginManager.getExtensionClassNames(pluginId); // extensionClassNames = pluginManager.getExtensionClassNames(pluginId);
// for (String extension : extensionClassNames) { // for (String extension : extensionClassNames) {
// System.out.println(" " + extension); // System.out.println(" " + extension);
// } // }
} }
// stop the plugins // stop the plugins
pluginManager.stopPlugins(); pluginManager.stopPlugins();
/* /*
Runtime.getRuntime().addShutdownHook(new Thread() { Runtime.getRuntime().addShutdownHook(new Thread() {
@Override @Override
public void run() { public void run() {
pluginManager.stopPlugins(); pluginManager.stopPlugins();
} }
}); });
*/ */
} }
private static void printLogo() { private static void printLogo() {
System.out.println(StringUtils.repeat("#", 40)); System.out.println(StringUtils.repeat("#", 40));
System.out.println(StringUtils.center("PF4J-DEMO", 40)); System.out.println(StringUtils.center("PF4J-DEMO", 40));
System.out.println(StringUtils.repeat("#", 40)); System.out.println(StringUtils.repeat("#", 40));
} }
} }

2
demo_gradle/plugins/disabled.txt

@ -3,4 +3,4 @@
# - add one plugin id on each line # - add one plugin id on each line
# - put this file in plugins folder # - put this file in plugins folder
######################################## ########################################
#welcome-plugin #welcome-plugin

2
demo_gradle/plugins/enabled.txt

@ -3,4 +3,4 @@
# - add one plugin id on each line # - add one plugin id on each line
# - put this file in plugins folder # - put this file in plugins folder
######################################## ########################################
#welcome-plugin #welcome-plugin

6
demo_gradle/plugins/plugin2/src/main/java/ro/fortsoft/pf4j/demo/hello/HelloPlugin.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

2
pf4j/src/main/java/ro/fortsoft/pf4j/CompoundPluginRepository.java

@ -18,7 +18,7 @@ import java.util.List;
/** /**
* @author Decebal Suiu * @author Decebal Suiu
* @author Mário Franco * @author Mário Franco
*/ */
public class CompoundPluginRepository implements PluginRepository { public class CompoundPluginRepository implements PluginRepository {

8
pf4j/src/main/java/ro/fortsoft/pf4j/CyclicDependencyException.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -14,7 +14,7 @@ package ro.fortsoft.pf4j;
/** /**
* CyclicDependencyException will be thrown if a cyclic dependency is detected. * CyclicDependencyException will be thrown if a cyclic dependency is detected.
* *
* @author Decebal Suiu * @author Decebal Suiu
*/ */
class CyclicDependencyException extends PluginException { class CyclicDependencyException extends PluginException {

12
pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginDescriptorFinder.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2013 Decebal Suiu * Copyright 2013 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -13,9 +13,9 @@
package ro.fortsoft.pf4j; package ro.fortsoft.pf4j;
/** /**
* The default implementation for PluginDescriptorFinder. * The default implementation for PluginDescriptorFinder.
* Now, this class it's a "link" to {@link ro.fortsoft.pf4j.ManifestPluginDescriptorFinder}. * Now, this class it's a "link" to {@link ro.fortsoft.pf4j.ManifestPluginDescriptorFinder}.
* *
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public class DefaultPluginDescriptorFinder extends ManifestPluginDescriptorFinder { public class DefaultPluginDescriptorFinder extends ManifestPluginDescriptorFinder {
@ -23,5 +23,5 @@ public class DefaultPluginDescriptorFinder extends ManifestPluginDescriptorFinde
public DefaultPluginDescriptorFinder(PluginClasspath pluginClasspath) { public DefaultPluginDescriptorFinder(PluginClasspath pluginClasspath) {
super(pluginClasspath); super(pluginClasspath);
} }
} }

2
pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginRepository.java

@ -22,7 +22,7 @@ import java.util.List;
/** /**
* @author Decebal Suiu * @author Decebal Suiu
* @author Mário Franco * @author Mário Franco
*/ */
public class DefaultPluginRepository implements PluginRepository { public class DefaultPluginRepository implements PluginRepository {

2
pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginStatusProvider.java

@ -24,7 +24,7 @@ import ro.fortsoft.pf4j.util.FileUtils;
* The default implementation for PluginStatusProvider. * The default implementation for PluginStatusProvider.
* *
* @author Decebal Suiu * @author Decebal Suiu
* @author Mário Franco * @author Mário Franco
*/ */
public class DefaultPluginStatusProvider implements PluginStatusProvider { public class DefaultPluginStatusProvider implements PluginStatusProvider {

8
pf4j/src/main/java/ro/fortsoft/pf4j/DependencyResolver.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -26,7 +26,7 @@ import ro.fortsoft.pf4j.util.DirectedGraph;
class DependencyResolver { class DependencyResolver {
private static final Logger log = LoggerFactory.getLogger(DependencyResolver.class); private static final Logger log = LoggerFactory.getLogger(DependencyResolver.class);
private List<PluginWrapper> plugins; private List<PluginWrapper> plugins;
public DependencyResolver(List<PluginWrapper> plugins) { public DependencyResolver(List<PluginWrapper> plugins) {

12
pf4j/src/main/java/ro/fortsoft/pf4j/DevelopmentPluginClasspath.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2013 Decebal Suiu * Copyright 2013 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -14,14 +14,14 @@ package ro.fortsoft.pf4j;
/** /**
* Overwrite classes directories to "target/classes" and lib directories to "target/lib". * Overwrite classes directories to "target/classes" and lib directories to "target/lib".
* *
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public class DevelopmentPluginClasspath extends PluginClasspath { public class DevelopmentPluginClasspath extends PluginClasspath {
private static final String DEVELOPMENT_CLASSES_DIRECTORY = "target/classes"; private static final String DEVELOPMENT_CLASSES_DIRECTORY = "target/classes";
private static final String DEVELOPMENT_LIB_DIRECTORY = "target/lib"; private static final String DEVELOPMENT_LIB_DIRECTORY = "target/lib";
public DevelopmentPluginClasspath() { public DevelopmentPluginClasspath() {
super(); super();
} }
@ -32,5 +32,5 @@ public class DevelopmentPluginClasspath extends PluginClasspath {
libDirectories.add(DEVELOPMENT_LIB_DIRECTORY); libDirectories.add(DEVELOPMENT_LIB_DIRECTORY);
} }
} }

8
pf4j/src/main/java/ro/fortsoft/pf4j/Extension.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -28,5 +28,5 @@ import java.lang.annotation.Target;
public @interface Extension { public @interface Extension {
int ordinal() default 0; int ordinal() default 0;
} }

6
pf4j/src/main/java/ro/fortsoft/pf4j/ExtensionPoint.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

2
pf4j/src/main/java/ro/fortsoft/pf4j/ExtensionWrapper.java

@ -52,4 +52,4 @@ public class ExtensionWrapper<T> implements Comparable<ExtensionWrapper<T>> {
this.extensionFactory = extensionFactory; this.extensionFactory = extensionFactory;
} }
} }

36
pf4j/src/main/java/ro/fortsoft/pf4j/ExtensionsIndexer.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2013 Decebal Suiu * Copyright 2013 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -37,9 +37,9 @@ import javax.tools.StandardLocation;
public class ExtensionsIndexer extends AbstractProcessor { public class ExtensionsIndexer extends AbstractProcessor {
public static final String EXTENSIONS_RESOURCE = "META-INF/extensions.idx"; public static final String EXTENSIONS_RESOURCE = "META-INF/extensions.idx";
private List<TypeElement> extensions = new ArrayList<TypeElement>(); private List<TypeElement> extensions = new ArrayList<TypeElement>();
@Override @Override
public SourceVersion getSupportedSourceVersion() { public SourceVersion getSupportedSourceVersion() {
return SourceVersion.latest(); return SourceVersion.latest();
@ -49,16 +49,16 @@ public class ExtensionsIndexer extends AbstractProcessor {
public Set<String> getSupportedAnnotationTypes() { public Set<String> getSupportedAnnotationTypes() {
Set<String> annotationTypes = new HashSet<String>(); Set<String> annotationTypes = new HashSet<String>();
annotationTypes.add(Extension.class.getName()); annotationTypes.add(Extension.class.getName());
return annotationTypes; return annotationTypes;
} }
@Override @Override
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
if (roundEnv.processingOver()) { if (roundEnv.processingOver()) {
return false; return false;
} }
for (Element element : roundEnv.getElementsAnnotatedWith(Extension.class)) { for (Element element : roundEnv.getElementsAnnotatedWith(Extension.class)) {
if (!(element instanceof TypeElement)) { if (!(element instanceof TypeElement)) {
continue; continue;
@ -69,7 +69,7 @@ public class ExtensionsIndexer extends AbstractProcessor {
processingEnv.getMessager().printMessage(Kind.NOTE, message); processingEnv.getMessager().printMessage(Kind.NOTE, message);
extensions.add(typeElement); extensions.add(typeElement);
} }
/* /*
if (!roundEnv.processingOver()) { if (!roundEnv.processingOver()) {
return false; return false;
@ -77,17 +77,17 @@ public class ExtensionsIndexer extends AbstractProcessor {
*/ */
write(); write();
return false; return false;
// return true; // no further processing of this annotation type // return true; // no further processing of this annotation type
} }
private void write() { private void write() {
Set<String> entries = new HashSet<String>(); Set<String> entries = new HashSet<String>();
for (TypeElement typeElement : extensions) { for (TypeElement typeElement : extensions) {
entries.add(processingEnv.getElementUtils().getBinaryName(typeElement).toString()); entries.add(processingEnv.getElementUtils().getBinaryName(typeElement).toString());
} }
read(entries); // read old entries read(entries); // read old entries
write(entries); // write entries write(entries); // write entries
} }
@ -107,7 +107,7 @@ public class ExtensionsIndexer extends AbstractProcessor {
processingEnv.getMessager().printMessage(Kind.ERROR, e.toString()); processingEnv.getMessager().printMessage(Kind.ERROR, e.toString());
} }
} }
private void read(Set<String> entries) { private void read(Set<String> entries) {
try { try {
FileObject file = processingEnv.getFiler().getResource(StandardLocation.CLASS_OUTPUT, "", EXTENSIONS_RESOURCE); FileObject file = processingEnv.getFiler().getResource(StandardLocation.CLASS_OUTPUT, "", EXTENSIONS_RESOURCE);
@ -119,17 +119,17 @@ public class ExtensionsIndexer extends AbstractProcessor {
// java6 does not support reading old index files // java6 does not support reading old index files
} }
} }
public static void readIndex(Reader reader, Set<String> entries) throws IOException { public static void readIndex(Reader reader, Set<String> entries) throws IOException {
BufferedReader bufferedReader = new BufferedReader(reader); BufferedReader bufferedReader = new BufferedReader(reader);
String line; String line;
while ((line = bufferedReader.readLine()) != null) { while ((line = bufferedReader.readLine()) != null) {
entries.add(line); entries.add(line);
} }
reader.close(); reader.close();
} }
} }

6
pf4j/src/main/java/ro/fortsoft/pf4j/Plugin.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

10
pf4j/src/main/java/ro/fortsoft/pf4j/PluginDescriptorFinder.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -18,11 +18,11 @@ import java.io.File;
* Find a plugin descriptor in a directory (plugin repository). * Find a plugin descriptor in a directory (plugin repository).
* You can find in manifest file @see DefaultPluginDescriptorFinder, * You can find in manifest file @see DefaultPluginDescriptorFinder,
* xml file, properties file, java services (with ServiceLoader), etc. * xml file, properties file, java services (with ServiceLoader), etc.
* *
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public interface PluginDescriptorFinder { public interface PluginDescriptorFinder {
public PluginDescriptor find(File pluginRepository) throws PluginException; public PluginDescriptor find(File pluginRepository) throws PluginException;
} }

6
pf4j/src/main/java/ro/fortsoft/pf4j/PluginException.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

10
pf4j/src/main/java/ro/fortsoft/pf4j/PluginNotFoundException.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -18,12 +18,12 @@ package ro.fortsoft.pf4j;
class PluginNotFoundException extends PluginException { class PluginNotFoundException extends PluginException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String pluginId; private String pluginId;
public PluginNotFoundException(String pluginId) { public PluginNotFoundException(String pluginId) {
super("Plugin '" + pluginId + "' not found."); super("Plugin '" + pluginId + "' not found.");
this.pluginId = pluginId; this.pluginId = pluginId;
} }

2
pf4j/src/main/java/ro/fortsoft/pf4j/PluginRepository.java

@ -19,7 +19,7 @@ import java.util.List;
* Directory whose contents are .zip files used as plugins. * Directory whose contents are .zip files used as plugins.
* *
* @author Decebal Suiu * @author Decebal Suiu
* @author Mário Franco * @author Mário Franco
*/ */
public interface PluginRepository { public interface PluginRepository {

2
pf4j/src/main/java/ro/fortsoft/pf4j/PluginStatusProvider.java

@ -14,7 +14,7 @@ package ro.fortsoft.pf4j;
/** /**
* @author Decebal Suiu * @author Decebal Suiu
* @author Mário Franco * @author Mário Franco
*/ */
public interface PluginStatusProvider { public interface PluginStatusProvider {

24
pf4j/src/main/java/ro/fortsoft/pf4j/RuntimeMode.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2013 Decebal Suiu * Copyright 2013 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -20,20 +20,20 @@ import java.util.NoSuchElementException;
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public enum RuntimeMode { public enum RuntimeMode {
DEVELOPMENT("development"), // development DEVELOPMENT("development"), // development
DEPLOYMENT("deployment"); // deployment DEPLOYMENT("deployment"); // deployment
private final String name; private final String name;
private static final Map<String, RuntimeMode> map = new HashMap<String, RuntimeMode>(); private static final Map<String, RuntimeMode> map = new HashMap<String, RuntimeMode>();
static { static {
for (RuntimeMode mode : RuntimeMode.values()) { for (RuntimeMode mode : RuntimeMode.values()) {
map.put(mode.name, mode); map.put(mode.name, mode);
} }
} }
private RuntimeMode(final String name) { private RuntimeMode(final String name) {
this.name = name; this.name = name;
} }
@ -42,14 +42,14 @@ public enum RuntimeMode {
public String toString() { public String toString() {
return name; return name;
} }
public static RuntimeMode byName(String name) { public static RuntimeMode byName(String name) {
if (map.containsKey(name)) { if (map.containsKey(name)) {
return map.get(name); return map.get(name);
} }
throw new NoSuchElementException("Cannot found PF4J runtime mode with name '" + name + throw new NoSuchElementException("Cannot found PF4J runtime mode with name '" + name +
"'. Must be 'development' or 'deployment'."); "'. Must be 'development' or 'deployment'.");
} }
} }

6
pf4j/src/main/java/ro/fortsoft/pf4j/util/AndFileFilter.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2013 Decebal Suiu * Copyright 2013 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

342
pf4j/src/main/java/ro/fortsoft/pf4j/util/DirectedGraph.java

@ -1,171 +1,171 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
*/ */
package ro.fortsoft.pf4j.util; package ro.fortsoft.pf4j.util;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Stack; import java.util.Stack;
/** /**
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public class DirectedGraph<V> { public class DirectedGraph<V> {
/** /**
* The implementation here is basically an adjacency list, but instead * The implementation here is basically an adjacency list, but instead
* of an array of lists, a Map is used to map each vertex to its list of * of an array of lists, a Map is used to map each vertex to its list of
* adjacent vertices. * adjacent vertices.
*/ */
private Map<V, List<V>> neighbors = new HashMap<V, List<V>>(); private Map<V, List<V>> neighbors = new HashMap<V, List<V>>();
/** /**
* Add a vertex to the graph. Nothing happens if vertex is already in graph. * Add a vertex to the graph. Nothing happens if vertex is already in graph.
*/ */
public void addVertex(V vertex) { public void addVertex(V vertex) {
if (neighbors.containsKey(vertex)) { if (neighbors.containsKey(vertex)) {
return; return;
} }
neighbors.put(vertex, new ArrayList<V>()); neighbors.put(vertex, new ArrayList<V>());
} }
/** /**
* True if graph contains vertex. * True if graph contains vertex.
*/ */
public boolean containsVertex(V vertex) { public boolean containsVertex(V vertex) {
return neighbors.containsKey(vertex); return neighbors.containsKey(vertex);
} }
/** /**
* Add an edge to the graph; if either vertex does not exist, it's added. * Add an edge to the graph; if either vertex does not exist, it's added.
* This implementation allows the creation of multi-edges and self-loops. * This implementation allows the creation of multi-edges and self-loops.
*/ */
public void addEdge(V from, V to) { public void addEdge(V from, V to) {
this.addVertex(from); this.addVertex(from);
this.addVertex(to); this.addVertex(to);
neighbors.get(from).add(to); neighbors.get(from).add(to);
} }
/** /**
* Remove an edge from the graph. Nothing happens if no such edge. * Remove an edge from the graph. Nothing happens if no such edge.
* @throws IllegalArgumentException if either vertex doesn't exist. * @throws IllegalArgumentException if either vertex doesn't exist.
*/ */
public void remove(V from, V to) { public void remove(V from, V to) {
if (!(this.containsVertex(from) && this.containsVertex(to))) { if (!(this.containsVertex(from) && this.containsVertex(to))) {
throw new IllegalArgumentException("Nonexistent vertex"); throw new IllegalArgumentException("Nonexistent vertex");
} }
neighbors.get(from).remove(to); neighbors.get(from).remove(to);
} }
/** /**
* Report (as a Map) the out-degree of each vertex. * Report (as a Map) the out-degree of each vertex.
*/ */
public Map<V, Integer> outDegree() { public Map<V, Integer> outDegree() {
Map<V, Integer> result = new HashMap<V, Integer>(); Map<V, Integer> result = new HashMap<V, Integer>();
for (V vertex : neighbors.keySet()) { for (V vertex : neighbors.keySet()) {
result.put(vertex, neighbors.get(vertex).size()); result.put(vertex, neighbors.get(vertex).size());
} }
return result; return result;
} }
/** /**
* Report (as a Map) the in-degree of each vertex. * Report (as a Map) the in-degree of each vertex.
*/ */
public Map<V,Integer> inDegree() { public Map<V,Integer> inDegree() {
Map<V, Integer> result = new HashMap<V, Integer>(); Map<V, Integer> result = new HashMap<V, Integer>();
for (V vertex : neighbors.keySet()) { for (V vertex : neighbors.keySet()) {
result.put(vertex, 0); // all in-degrees are 0 result.put(vertex, 0); // all in-degrees are 0
} }
for (V from : neighbors.keySet()) { for (V from : neighbors.keySet()) {
for (V to : neighbors.get(from)) { for (V to : neighbors.get(from)) {
result.put(to, result.get(to) + 1); // increment in-degree result.put(to, result.get(to) + 1); // increment in-degree
} }
} }
return result; return result;
} }
/** /**
* Report (as a List) the topological sort of the vertices; null for no such sort. * Report (as a List) the topological sort of the vertices; null for no such sort.
*/ */
public List<V> topologicalSort() { public List<V> topologicalSort() {
Map<V, Integer> degree = inDegree(); Map<V, Integer> degree = inDegree();
// determine all vertices with zero in-degree // determine all vertices with zero in-degree
Stack<V> zeroVertices = new Stack<V>(); // stack as good as any here Stack<V> zeroVertices = new Stack<V>(); // stack as good as any here
for (V v : degree.keySet()) { for (V v : degree.keySet()) {
if (degree.get(v) == 0) { if (degree.get(v) == 0) {
zeroVertices.push(v); zeroVertices.push(v);
} }
} }
// determine the topological order // determine the topological order
List<V> result = new ArrayList<V>(); List<V> result = new ArrayList<V>();
while (!zeroVertices.isEmpty()) { while (!zeroVertices.isEmpty()) {
V vertex = zeroVertices.pop(); // choose a vertex with zero in-degree V vertex = zeroVertices.pop(); // choose a vertex with zero in-degree
result.add(vertex); // vertex 'v' is next in topological order result.add(vertex); // vertex 'v' is next in topological order
// "remove" vertex 'v' by updating its neighbors // "remove" vertex 'v' by updating its neighbors
for (V neighbor : neighbors.get(vertex)) { for (V neighbor : neighbors.get(vertex)) {
degree.put(neighbor, degree.get(neighbor) - 1); degree.put(neighbor, degree.get(neighbor) - 1);
// remember any vertices that now have zero in-degree // remember any vertices that now have zero in-degree
if (degree.get(neighbor) == 0) { if (degree.get(neighbor) == 0) {
zeroVertices.push(neighbor); zeroVertices.push(neighbor);
} }
} }
} }
// check that we have used the entire graph (if not, there was a cycle) // check that we have used the entire graph (if not, there was a cycle)
if (result.size() != neighbors.size()) { if (result.size() != neighbors.size()) {
return null; return null;
} }
return result; return result;
} }
/** /**
* Report (as a List) the reverse topological sort of the vertices; null for no such sort. * Report (as a List) the reverse topological sort of the vertices; null for no such sort.
*/ */
public List<V> reverseTopologicalSort() { public List<V> reverseTopologicalSort() {
List<V> list = topologicalSort(); List<V> list = topologicalSort();
if (list == null) { if (list == null) {
return null; return null;
} }
Collections.reverse(list); Collections.reverse(list);
return list; return list;
} }
/** /**
* True if graph is a dag (directed acyclic graph). * True if graph is a dag (directed acyclic graph).
*/ */
public boolean isDag () { public boolean isDag () {
return topologicalSort() != null; return topologicalSort() != null;
} }
/** /**
* String representation of graph. * String representation of graph.
*/ */
@Override @Override
public String toString() { public String toString() {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (V vertex : neighbors.keySet()) { for (V vertex : neighbors.keySet()) {
sb.append("\n " + vertex + " -> " + neighbors.get(vertex)); sb.append("\n " + vertex + " -> " + neighbors.get(vertex));
} }
return sb.toString(); return sb.toString();
} }
} }

8
pf4j/src/main/java/ro/fortsoft/pf4j/util/DirectoryFileFilter.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -17,7 +17,7 @@ import java.io.FileFilter;
/** /**
* Filter accepts files that are directories. * Filter accepts files that are directories.
* *
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public class DirectoryFileFilter implements FileFilter { public class DirectoryFileFilter implements FileFilter {

8
pf4j/src/main/java/ro/fortsoft/pf4j/util/ExtensionFileFilter.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -17,7 +17,7 @@ import java.io.FileFilter;
/** /**
* Filter accepts any file ending in extension. The case of the filename is ignored. * Filter accepts any file ending in extension. The case of the filename is ignored.
* *
* @author Decebal Suiu * @author Decebal Suiu
*/ */
public class ExtensionFileFilter implements FileFilter { public class ExtensionFileFilter implements FileFilter {

8
pf4j/src/main/java/ro/fortsoft/pf4j/util/HiddenFilter.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2013 Decebal Suiu * Copyright 2013 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.
@ -17,7 +17,7 @@ import java.io.FileFilter;
/** /**
* Filter that only accepts hidden files. * Filter that only accepts hidden files.
* *
* @author decebal.suiu * @author decebal.suiu
*/ */
public class HiddenFilter implements FileFilter { public class HiddenFilter implements FileFilter {

6
pf4j/src/main/java/ro/fortsoft/pf4j/util/JarFileFilter.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

6
pf4j/src/main/java/ro/fortsoft/pf4j/util/NotFileFilter.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2013 Decebal Suiu * Copyright 2013 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

6
pf4j/src/main/java/ro/fortsoft/pf4j/util/StringUtils.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

6
pf4j/src/main/java/ro/fortsoft/pf4j/util/Unzip.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

6
pf4j/src/main/java/ro/fortsoft/pf4j/util/ZipFileFilter.java

@ -1,11 +1,11 @@
/* /*
* Copyright 2012 Decebal Suiu * Copyright 2012 Decebal Suiu
* *
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with
* the License. You may obtain a copy of the License in the LICENSE file, or at: * the License. You may obtain a copy of the License in the LICENSE file, or at:
* *
* http://www.apache.org/licenses/LICENSE-2.0 * http://www.apache.org/licenses/LICENSE-2.0
* *
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License. * specific language governing permissions and limitations under the License.

Loading…
Cancel
Save