Author: rdonkin
Date: Sat Mar 30 17:43:25 2013
New Revision: 1462812
URL: http://svn.apache.org/r1462812
Log:
Move nested classes to top level
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/DeclaredFilter.java
(with props)
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/FilesOnlyFilter.java
(with props)
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Filters.java
(with props)
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LegalFilter.java
(with props)
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LicenseFilter.java
(with props)
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NotFilter.java
(with props)
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NoticeFilter.java
(with props)
Modified:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/DeclaredFilter.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/DeclaredFilter.java?rev=1462812&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/DeclaredFilter.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/DeclaredFilter.java
Sat Mar 30 17:43:25 2013
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 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.
+ */
+package org.apache.creadur.tentacles;
+
+import java.io.File;
+import java.io.FileFilter;
+
+class DeclaredFilter implements FileFilter {
+ private final File file;
+
+ DeclaredFilter(final File file) {
+ this.file = file;
+ }
+
+ @Override
+ public boolean accept(File file) {
+ while (file != null) {
+ if (file.equals(this.file)) {
+ break;
+ }
+
+ if (file.isDirectory() && file.getName().endsWith(".contents")) {
+ return false;
+ }
+ file = file.getParentFile();
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/DeclaredFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/FilesOnlyFilter.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/FilesOnlyFilter.java?rev=1462812&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/FilesOnlyFilter.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/FilesOnlyFilter.java
Sat Mar 30 17:43:25 2013
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 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.
+ */
+package org.apache.creadur.tentacles;
+
+import java.io.File;
+import java.io.FileFilter;
+
+final class FilesOnlyFilter implements FileFilter {
+ @Override
+ public boolean accept(final File pathname) {
+ return pathname.isFile();
+ }
+}
\ No newline at end of file
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/FilesOnlyFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Filters.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Filters.java?rev=1462812&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Filters.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Filters.java
Sat Mar 30 17:43:25 2013
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 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.
+ */
+package org.apache.creadur.tentacles;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.List;
+
+class Filters implements FileFilter {
+
+ List<FileFilter> filters = new ArrayList<FileFilter>();
+
+ Filters(final FileFilter... filters) {
+ for (final FileFilter filter : filters) {
+ this.filters.add(filter);
+ }
+ }
+
+ @Override
+ public boolean accept(final File file) {
+ for (final FileFilter filter : this.filters) {
+ if (!filter.accept(file)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Filters.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LegalFilter.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LegalFilter.java?rev=1462812&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LegalFilter.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LegalFilter.java
Sat Mar 30 17:43:25 2013
@@ -0,0 +1,33 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 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.
+ */
+package org.apache.creadur.tentacles;
+
+import java.io.File;
+import java.io.FileFilter;
+
+class LegalFilter implements FileFilter {
+
+ private static final NoticeFilter notice = new NoticeFilter();
+ private static final LicenseFilter license = new LicenseFilter();
+
+ @Override
+ public boolean accept(final File pathname) {
+ return notice.accept(pathname) || license.accept(pathname);
+ }
+}
\ No newline at end of file
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LegalFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LicenseFilter.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LicenseFilter.java?rev=1462812&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LicenseFilter.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LicenseFilter.java
Sat Mar 30 17:43:25 2013
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 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.
+ */
+package org.apache.creadur.tentacles;
+
+import java.io.File;
+import java.io.FileFilter;
+
+class LicenseFilter implements FileFilter {
+ @Override
+ public boolean accept(final File pathname) {
+ final String name = pathname.getName().toLowerCase();
+
+ if (name.equals("license")) {
+ return true;
+ }
+ if (name.equals("license.txt")) {
+ return true;
+ }
+
+ return false;
+ }
+}
\ No newline at end of file
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/LicenseFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java?rev=1462812&r1=1462811&r2=1462812&view=diff
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java
(original)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/Main.java
Sat Mar 30 17:43:25 2013
@@ -128,12 +128,7 @@ public class Main {
prepare();
final List<File> jars =
- this.fileSystem.collect(this.repository, new FileFilter() {
- @Override
- public boolean accept(final File pathname) {
- return pathname.isFile();
- }
- });
+ this.fileSystem.collect(this.repository, new
FilesOnlyFilter());
final List<Archive> archives = new ArrayList<Archive>();
for (final File file : jars) {
@@ -598,108 +593,6 @@ public class Main {
return file;
}
- private static class LegalFilter implements FileFilter {
-
- private static final NoticeFilter notice = new NoticeFilter();
- private static final LicenseFilter license = new LicenseFilter();
-
- @Override
- public boolean accept(final File pathname) {
- return notice.accept(pathname) || license.accept(pathname);
- }
- }
-
- private static class NoticeFilter implements FileFilter {
- @Override
- public boolean accept(final File pathname) {
- final String name = pathname.getName().toLowerCase();
-
- if (name.equals("notice")) {
- return true;
- }
- if (name.equals("notice.txt")) {
- return true;
- }
-
- return false;
- }
- }
-
- private static class LicenseFilter implements FileFilter {
- @Override
- public boolean accept(final File pathname) {
- final String name = pathname.getName().toLowerCase();
-
- if (name.equals("license")) {
- return true;
- }
- if (name.equals("license.txt")) {
- return true;
- }
-
- return false;
- }
- }
-
- private static class N implements FileFilter {
- private final FileFilter filter;
-
- private N(final FileFilter filter) {
- this.filter = filter;
- }
-
- @Override
- public boolean accept(final File pathname) {
- return !this.filter.accept(pathname);
- }
- }
-
- private static class DeclaredFilter implements FileFilter {
- private final File file;
-
- private DeclaredFilter(final File file) {
- this.file = file;
- }
-
- @Override
- public boolean accept(File file) {
- while (file != null) {
- if (file.equals(this.file)) {
- break;
- }
-
- if (file.isDirectory() &&
file.getName().endsWith(".contents")) {
- return false;
- }
- file = file.getParentFile();
- }
-
- return true;
- }
- }
-
- private static class Filters implements FileFilter {
-
- List<FileFilter> filters = new ArrayList<FileFilter>();
-
- private Filters(final FileFilter... filters) {
- for (final FileFilter filter : filters) {
- this.filters.add(filter);
- }
- }
-
- @Override
- public boolean accept(final File file) {
- for (final FileFilter filter : this.filters) {
- if (!filter.accept(file)) {
- return false;
- }
- }
-
- return true;
- }
- }
-
public class Archive {
private final URI uri;
@@ -769,7 +662,7 @@ public class Main {
final File jarContents = contents(this.file);
final List<File> legal =
Main.this.fileSystem.collect(jarContents, new Filters(
- new N(new DeclaredFilter(jarContents)),
+ new NotFilter(new DeclaredFilter(jarContents)),
new LegalFilter()));
final Map<URI, URI> map = new LinkedHashMap<URI, URI>();
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NotFilter.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NotFilter.java?rev=1462812&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NotFilter.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NotFilter.java
Sat Mar 30 17:43:25 2013
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 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.
+ */
+package org.apache.creadur.tentacles;
+
+import java.io.File;
+import java.io.FileFilter;
+
+class NotFilter implements FileFilter {
+ private final FileFilter filter;
+
+ NotFilter(final FileFilter filter) {
+ this.filter = filter;
+ }
+
+ @Override
+ public boolean accept(final File pathname) {
+ return !this.filter.accept(pathname);
+ }
+}
\ No newline at end of file
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NotFilter.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NoticeFilter.java
URL:
http://svn.apache.org/viewvc/creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NoticeFilter.java?rev=1462812&view=auto
==============================================================================
---
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NoticeFilter.java
(added)
+++
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NoticeFilter.java
Sat Mar 30 17:43:25 2013
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * 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 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.
+ */
+package org.apache.creadur.tentacles;
+
+import java.io.File;
+import java.io.FileFilter;
+
+class NoticeFilter implements FileFilter {
+ @Override
+ public boolean accept(final File pathname) {
+ final String name = pathname.getName().toLowerCase();
+
+ if (name.equals("notice")) {
+ return true;
+ }
+ if (name.equals("notice.txt")) {
+ return true;
+ }
+
+ return false;
+ }
+}
\ No newline at end of file
Propchange:
creadur/tentacles/trunk/src/main/java/org/apache/creadur/tentacles/NoticeFilter.java
------------------------------------------------------------------------------
svn:eol-style = native