Skip to content

Commit 47d1c6f

Browse files
committed
新規追加
1 parent 6fc8d33 commit 47d1c6f

File tree

18 files changed

+1172
-0
lines changed

18 files changed

+1172
-0
lines changed

.classpath

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
4+
<classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
5+
<classpathentry kind="src" path="src/main/java" including="**/*.java"/>
6+
<classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
7+
<classpathentry kind="output" path="target/classes"/>
8+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
9+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/3.0.5/maven-plugin-api-3.0.5.jar"/>
10+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model/3.0.5/maven-model-3.0.5.jar"/>
11+
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/2.0.6/plexus-utils-2.0.6.jar"/>
12+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-artifact/3.0.5/maven-artifact-3.0.5.jar"/>
13+
<classpathentry kind="var" path="M2_REPO/org/sonatype/sisu/sisu-inject-plexus/2.3.0/sisu-inject-plexus-2.3.0.jar"/>
14+
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar"/>
15+
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-classworlds/2.4/plexus-classworlds-2.4.jar"/>
16+
<classpathentry kind="var" path="M2_REPO/org/sonatype/sisu/sisu-inject-bean/2.3.0/sisu-inject-bean-2.3.0.jar"/>
17+
<classpathentry kind="var" path="M2_REPO/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar"/>
18+
<classpathentry kind="var" path="M2_REPO/org/sonatype/sisu/sisu-guava/0.9.9/sisu-guava-0.9.9.jar"/>
19+
<classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/>
20+
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
21+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-core/3.0.5/maven-core-3.0.5.jar"/>
22+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-settings/3.0.5/maven-settings-3.0.5.jar"/>
23+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-settings-builder/3.0.5/maven-settings-builder-3.0.5.jar"/>
24+
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-interpolation/1.14/plexus-interpolation-1.14.jar"/>
25+
<classpathentry kind="var" path="M2_REPO/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar"/>
26+
<classpathentry kind="var" path="M2_REPO/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar"/>
27+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/3.0.5/maven-repository-metadata-3.0.5.jar"/>
28+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-model-builder/3.0.5/maven-model-builder-3.0.5.jar"/>
29+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-aether-provider/3.0.5/maven-aether-provider-3.0.5.jar"/>
30+
<classpathentry kind="var" path="M2_REPO/org/sonatype/aether/aether-api/1.13.1/aether-api-1.13.1.jar"/>
31+
<classpathentry kind="var" path="M2_REPO/org/sonatype/aether/aether-spi/1.13.1/aether-spi-1.13.1.jar"/>
32+
<classpathentry kind="var" path="M2_REPO/org/sonatype/aether/aether-util/1.13.1/aether-util-1.13.1.jar"/>
33+
<classpathentry kind="var" path="M2_REPO/org/sonatype/aether/aether-impl/1.13.1/aether-impl-1.13.1.jar"/>
34+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/plugin-testing/maven-plugin-testing-harness/2.1/maven-plugin-testing-harness-2.1.jar"/>
35+
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-archiver/2.2/plexus-archiver-2.2.jar"/>
36+
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-9-stable-1/plexus-container-default-1.0-alpha-9-stable-1.jar"/>
37+
<classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
38+
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-io/2.0.4/plexus-io-2.0.4.jar"/>
39+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-compat/3.0.5/maven-compat-3.0.5.jar"/>
40+
<classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/2.4/wagon-provider-api-2.4.jar"/>
41+
</classpath>

.project

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>commentout-by-javaversion-maven-plugin</name>
4+
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

.settings/org.eclipse.jdt.core.prefs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#Thu Mar 08 15:39:11 JST 2018
2+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
3+
org.eclipse.jdt.core.compiler.compliance=1.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
6+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
7+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
9+
eclipse.preferences.version=1
10+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
11+
org.eclipse.jdt.core.compiler.source=1.8
12+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error

pom.xml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.github.nimbus-org</groupId>
5+
<artifactId>commentout-by-javaversion-maven-plugin</artifactId>
6+
<version>1.0</version>
7+
<packaging>maven-plugin</packaging>
8+
<name>commentout-by-javaversion-maven-plugin</name>
9+
<properties>
10+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
11+
</properties>
12+
<dependencies>
13+
<dependency>
14+
<groupId>org.apache.maven</groupId>
15+
<artifactId>maven-plugin-api</artifactId>
16+
<version>3.5.2</version>
17+
</dependency>
18+
<dependency>
19+
<groupId>junit</groupId>
20+
<artifactId>junit</artifactId>
21+
<version>4.11</version>
22+
<scope>test</scope>
23+
</dependency>
24+
<dependency>
25+
<groupId>org.apache.maven</groupId>
26+
<artifactId>maven-plugin-api</artifactId>
27+
<version>3.0.5</version>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.apache.maven</groupId>
31+
<artifactId>maven-model</artifactId>
32+
<version>3.0.5</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.apache.maven</groupId>
36+
<artifactId>maven-core</artifactId>
37+
<version>3.0.5</version>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.apache.maven.plugin-testing</groupId>
41+
<artifactId>maven-plugin-testing-harness</artifactId>
42+
<version>2.1</version>
43+
<scope>test</scope>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.apache.maven</groupId>
47+
<artifactId>maven-compat</artifactId>
48+
<version>3.0.5</version>
49+
<scope>test</scope>
50+
</dependency>
51+
</dependencies>
52+
<build>
53+
<plugins>
54+
<plugin>
55+
<groupId>org.apache.maven.plugins</groupId>
56+
<artifactId>maven-compiler-plugin</artifactId>
57+
<version>3.0</version>
58+
<configuration>
59+
<source>1.8</source>
60+
<target>1.8</target>
61+
</configuration>
62+
</plugin>
63+
<plugin>
64+
<groupId>org.apache.maven.plugins</groupId>
65+
<artifactId>maven-surefire-plugin</artifactId>
66+
<version>2.14</version>
67+
<configuration>
68+
<reuseForks>false</reuseForks>
69+
</configuration>
70+
</plugin>
71+
</plugins>
72+
</build>
73+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
* This software is distributed under following license based on modified BSD
3+
* style license.
4+
* ----------------------------------------------------------------------
5+
*
6+
* Copyright 2003 The Nimbus Project. All rights reserved.
7+
*
8+
* Redistribution and use in source and binary forms, with or without
9+
* modification, are permitted provided that the following conditions are met:
10+
*
11+
* 1. Redistributions of source code must retain the above copyright notice,
12+
* this list of conditions and the following disclaimer.
13+
* 2. Redistributions in binary form must reproduce the above copyright notice,
14+
* this list of conditions and the following disclaimer in the documentation
15+
* and/or other materials provided with the distribution.
16+
*
17+
* THIS SOFTWARE IS PROVIDED BY THE NIMBUS PROJECT ``AS IS'' AND ANY EXPRESS
18+
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20+
* NO EVENT SHALL THE NIMBUS PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
21+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27+
*
28+
* The views and conclusions contained in the software and documentation are
29+
* those of the authors and should not be interpreted as representing official
30+
* policies, either expressed or implied, of the Nimbus Project.
31+
*/
32+
package jp.ossc.nimbus.plugin;
33+
34+
import java.io.File;
35+
import java.io.FilenameFilter;
36+
import java.io.Serializable;
37+
import java.util.regex.Matcher;
38+
import java.util.regex.Pattern;
39+
40+
public class FileFilter implements FilenameFilter, Serializable{
41+
42+
private static final long serialVersionUID = -7076739508599572780L;
43+
44+
private Pattern pattern;
45+
46+
/**
47+
* 正規表現を指定しないフィルタのインスタンスを生成する。<p>
48+
*/
49+
public FileFilter(){
50+
this(null);
51+
}
52+
53+
/**
54+
* 指定した正規表現のファイルのみを抽出するフィルタのインスタンスを生成する。<p>
55+
*
56+
* @param regex 正規表現
57+
*/
58+
public FileFilter(String regex){
59+
this(regex, 0);
60+
}
61+
62+
/**
63+
* 指定した正規表現のファイルのみを抽出するフィルタのインスタンスを生成する。<p>
64+
*
65+
* @param regex 正規表現
66+
* @param flags マッチフラグ
67+
*/
68+
public FileFilter(String regex, int flags){
69+
setPattern(regex, flags);
70+
}
71+
72+
/**
73+
* 指定した正規表現のファイルのみを抽出するように設定する。<p>
74+
*
75+
* @param regex 正規表現
76+
*/
77+
public void setPattern(String regex){
78+
if(regex == null){
79+
pattern = null;
80+
}else{
81+
pattern = Pattern.compile(regex);
82+
}
83+
}
84+
85+
/**
86+
* 指定した正規表現のファイルのみを抽出するように設定する。<p>
87+
*
88+
* @param regex 正規表現
89+
* @param flags マッチフラグ
90+
*/
91+
public void setPattern(String regex, int flags){
92+
if(regex == null){
93+
pattern = null;
94+
}else{
95+
pattern = Pattern.compile(regex, flags);
96+
}
97+
}
98+
99+
/**
100+
* 指定された正規表現のファイルかどうか判定する。<p>
101+
*
102+
* @param dir ディレクトリ
103+
* @param fileName ファイル名
104+
* @return 指定されたプレフィクスのファイルの場合true
105+
*/
106+
public boolean accept(File dir, String fileName) {
107+
if(pattern == null){
108+
return false;
109+
}
110+
final Matcher matcher = pattern.matcher(fileName);
111+
return matcher.matches();
112+
}
113+
}

0 commit comments

Comments
 (0)