You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mina.apache.org by ng...@apache.org on 2013/08/12 00:15:56 UTC

[01/50] [abbrv] git commit: Add missing @Deprecated annotation

Updated Branches:
  refs/heads/trunk [created] ada8bd828


Add missing @Deprecated annotation

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129715 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/73f4e1e2
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/73f4e1e2
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/73f4e1e2

Branch: refs/heads/trunk
Commit: 73f4e1e257b29cd7ad3eea6b9790c18bc39ac068
Parents: fbf96c7
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 14:47:53 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 14:47:53 2011 +0000

----------------------------------------------------------------------
 core/src/main/java/org/apache/ftpserver/listener/Listener.java | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/73f4e1e2/core/src/main/java/org/apache/ftpserver/listener/Listener.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/listener/Listener.java b/core/src/main/java/org/apache/ftpserver/listener/Listener.java
index 99aa033..a5eb918 100644
--- a/core/src/main/java/org/apache/ftpserver/listener/Listener.java
+++ b/core/src/main/java/org/apache/ftpserver/listener/Listener.java
@@ -161,6 +161,7 @@ public interface Listener {
      *         <code>IpFilterType.DENY</code>. This functionality is provided
      *         for backward compatibility purpose only.
      */
+    @Deprecated
     List<Subnet> getBlockedSubnets();
 
     /**


[33/50] [abbrv] git commit: Simplify testing with Eclipse when using SVN checkout from parent

Posted by ng...@apache.org.
Simplify testing with Eclipse when using SVN checkout from parent

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1130124 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/75f7e60f
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/75f7e60f
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/75f7e60f

Branch: refs/heads/trunk
Commit: 75f7e60f192439d2e1426eb37edec0bdb6725ab5
Parents: 341367b
Author: Sebastian Bazley <se...@apache.org>
Authored: Wed Jun 1 12:18:31 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Wed Jun 1 12:18:31 2011 +0000

----------------------------------------------------------------------
 core/src/test/java/org/apache/ftpserver/test/TestUtil.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/75f7e60f/core/src/test/java/org/apache/ftpserver/test/TestUtil.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/test/TestUtil.java b/core/src/test/java/org/apache/ftpserver/test/TestUtil.java
index 871cb24..92483c3 100644
--- a/core/src/test/java/org/apache/ftpserver/test/TestUtil.java
+++ b/core/src/test/java/org/apache/ftpserver/test/TestUtil.java
@@ -51,6 +51,12 @@ public class TestUtil {
         if (basedir != null) {
             return new File(basedir);
         } else {
+            // Are we using Eclipse based on parent directory?
+            File core = new File("core");
+            File check = new File(core,"src");
+            if (check.isDirectory()) {
+                return core;
+            }
             return new File(".");
         }
     }


[20/50] [abbrv] git commit: Fix eol-style

Posted by ng...@apache.org.
Fix eol-style

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129824 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/d040ac3e
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/d040ac3e
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/d040ac3e

Branch: refs/heads/trunk
Commit: d040ac3ea9d31fee0b3254cc6605cc27edb538a3
Parents: 9988eb9
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 17:43:18 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 17:43:18 2011 +0000

----------------------------------------------------------------------
 distribution/LICENSE.springframework.txt | 354 +++++++++++++-------------
 distribution/res/conf/users.properties   |  74 +++---
 2 files changed, 214 insertions(+), 214 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/d040ac3e/distribution/LICENSE.springframework.txt
----------------------------------------------------------------------
diff --git a/distribution/LICENSE.springframework.txt b/distribution/LICENSE.springframework.txt
index 32af289..66a27ec 100644
--- a/distribution/LICENSE.springframework.txt
+++ b/distribution/LICENSE.springframework.txt
@@ -1,177 +1,177 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/d040ac3e/distribution/res/conf/users.properties
----------------------------------------------------------------------
diff --git a/distribution/res/conf/users.properties b/distribution/res/conf/users.properties
index 9dc6714..f52442e 100644
--- a/distribution/res/conf/users.properties
+++ b/distribution/res/conf/users.properties
@@ -1,37 +1,37 @@
-# 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.
-
-# Password is "admin"
-ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3
-ftpserver.user.admin.homedirectory=./res/home
-ftpserver.user.admin.enableflag=true
-ftpserver.user.admin.writepermission=true
-ftpserver.user.admin.maxloginnumber=0
-ftpserver.user.admin.maxloginperip=0
-ftpserver.user.admin.idletime=0
-ftpserver.user.admin.uploadrate=0
-ftpserver.user.admin.downloadrate=0
-
-ftpserver.user.anonymous.userpassword=
-ftpserver.user.anonymous.homedirectory=./res/home
-ftpserver.user.anonymous.enableflag=true
-ftpserver.user.anonymous.writepermission=false
-ftpserver.user.anonymous.maxloginnumber=20
-ftpserver.user.anonymous.maxloginperip=2
-ftpserver.user.anonymous.idletime=300
-ftpserver.user.anonymous.uploadrate=4800
-ftpserver.user.anonymous.downloadrate=4800
+# 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.
+
+# Password is "admin"
+ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3
+ftpserver.user.admin.homedirectory=./res/home
+ftpserver.user.admin.enableflag=true
+ftpserver.user.admin.writepermission=true
+ftpserver.user.admin.maxloginnumber=0
+ftpserver.user.admin.maxloginperip=0
+ftpserver.user.admin.idletime=0
+ftpserver.user.admin.uploadrate=0
+ftpserver.user.admin.downloadrate=0
+
+ftpserver.user.anonymous.userpassword=
+ftpserver.user.anonymous.homedirectory=./res/home
+ftpserver.user.anonymous.enableflag=true
+ftpserver.user.anonymous.writepermission=false
+ftpserver.user.anonymous.maxloginnumber=20
+ftpserver.user.anonymous.maxloginperip=2
+ftpserver.user.anonymous.idletime=300
+ftpserver.user.anonymous.uploadrate=4800
+ftpserver.user.anonymous.downloadrate=4800


[14/50] [abbrv] git commit: Redundant assignment - variable can only be null here

Posted by ng...@apache.org.
Redundant assignment - variable can only be null here

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129755 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/0ccd7f08
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/0ccd7f08
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/0ccd7f08

Branch: refs/heads/trunk
Commit: 0ccd7f08f53ae0c8ca484c8e9470810d3a25c399
Parents: 03ef8ad
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:24:27 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:24:27 2011 +0000

----------------------------------------------------------------------
 core/src/main/java/org/apache/ftpserver/command/impl/PASS.java      | 1 -
 .../main/java/org/apache/ftpserver/command/impl/SITE_DESCUSER.java  | 1 -
 2 files changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/0ccd7f08/core/src/main/java/org/apache/ftpserver/command/impl/PASS.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/PASS.java b/core/src/main/java/org/apache/ftpserver/command/impl/PASS.java
index 16f594d..3e69124 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/PASS.java
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/PASS.java
@@ -166,7 +166,6 @@ public class PASS extends AbstractCommand {
 
                 authenticatedUser = userManager.authenticate(auth);
             } catch (AuthenticationFailedException e) {
-                authenticatedUser = null;
                 LOG.warn("User failed to log in");
             } catch (Exception e) {
                 authenticatedUser = null;

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/0ccd7f08/core/src/main/java/org/apache/ftpserver/command/impl/SITE_DESCUSER.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/SITE_DESCUSER.java b/core/src/main/java/org/apache/ftpserver/command/impl/SITE_DESCUSER.java
index c60bb7e..9ea09cd 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/SITE_DESCUSER.java
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/SITE_DESCUSER.java
@@ -86,7 +86,6 @@ public class SITE_DESCUSER extends AbstractCommand {
             }
         } catch (FtpException ex) {
             LOG.debug("Exception trying to get user from user manager", ex);
-            user = null;
         }
         if (user == null) {
             session.write(LocalizedFtpReply.translate(session, request, context,


[38/50] [abbrv] git commit: Simplified hashCode() of NativeFtpFile (FTPSERVER-375)

Posted by ng...@apache.org.
Simplified hashCode() of NativeFtpFile (FTPSERVER-375)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1137353 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/63bf7c86
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/63bf7c86
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/63bf7c86

Branch: refs/heads/trunk
Commit: 63bf7c86aca31e85264d661d13cfe90b72f491fd
Parents: b8f3543
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Sun Jun 19 11:58:07 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Sun Jun 19 11:58:07 2011 +0000

----------------------------------------------------------------------
 .../ftpserver/filesystem/nativefs/impl/NativeFtpFile.java       | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/63bf7c86/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
index c53f7c0..6e833dc 100644
--- a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
+++ b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
@@ -415,11 +415,10 @@ public class NativeFtpFile implements FtpFile {
     
 	@Override
 	public int hashCode() {
-		final int prime = 31;
 		try {
-			return prime  + ((file == null) ? 0 : file.getCanonicalFile().hashCode());
+			return file.getCanonicalFile().hashCode();
 		} catch (IOException e) {
-			return prime;
+			return 0;
 		}
 	}
 }


[10/50] [abbrv] git commit: Unnecessary casts

Posted by ng...@apache.org.
Unnecessary casts

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129746 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/c9aa57ef
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/c9aa57ef
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/c9aa57ef

Branch: refs/heads/trunk
Commit: c9aa57eff918dc35483a35c749d28878fdb22bfb
Parents: 733e0b1
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:12:03 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:12:03 2011 +0000

----------------------------------------------------------------------
 core/src/main/java/org/apache/ftpserver/command/impl/OPTS.java    | 2 +-
 .../main/java/org/apache/ftpserver/listener/nio/NioListener.java  | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/c9aa57ef/core/src/main/java/org/apache/ftpserver/command/impl/OPTS.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/OPTS.java b/core/src/main/java/org/apache/ftpserver/command/impl/OPTS.java
index f6e0c8b..9868f42 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/OPTS.java
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/OPTS.java
@@ -78,7 +78,7 @@ public class OPTS extends AbstractCommand {
 
         // call appropriate command method
         String optsRequest = "OPTS_" + argument;
-        Command command = (Command) COMMAND_MAP.get(optsRequest);
+        Command command = COMMAND_MAP.get(optsRequest);
         try {
             if (command != null) {
                 command.execute(session, context, request);

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/c9aa57ef/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java b/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
index 1bd82f6..8a4c708 100644
--- a/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
+++ b/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
@@ -126,8 +126,7 @@ public class NioListener extends AbstractListener {
             acceptor.getSessionConfig().setIdleTime(IdleStatus.BOTH_IDLE,
                     getIdleTimeout());
             // Decrease the default receiver buffer size
-            ((SocketSessionConfig) acceptor.getSessionConfig())
-                    .setReceiveBufferSize(512);
+            acceptor.getSessionConfig().setReceiveBufferSize(512);
     
             MdcInjectionFilter mdcFilter = new MdcInjectionFilter();
     


[35/50] [abbrv] git commit: New implementation of passive ports, uses random assignments of ports and has more efficient handling of wide passive port ranges. Thanks to Allen Firstenberg for the implementation! (FTPSERVER-420, FTPSERVER-419)

Posted by ng...@apache.org.
New implementation of passive ports, uses random assignments of ports and has more efficient handling of wide passive port ranges. Thanks to Allen Firstenberg for the implementation! (FTPSERVER-420, FTPSERVER-419)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1137251 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/4907aac4
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/4907aac4
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/4907aac4

Branch: refs/heads/trunk
Commit: 4907aac4b48fdd5fd64a6044e9f574216e8ec4a8
Parents: e09a432
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Sat Jun 18 21:33:32 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Sat Jun 18 21:33:32 2011 +0000

----------------------------------------------------------------------
 .../DataConnectionConfigurationFactory.java     |   3 +-
 .../org/apache/ftpserver/impl/PassivePorts.java | 134 ++++++++-------
 .../ftpserver/clienttests/PasvUsedPortTest.java |   5 -
 .../apache/ftpserver/impl/PassivePortsTest.java | 165 ++++++++-----------
 4 files changed, 145 insertions(+), 162 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/4907aac4/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java b/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
index 7349921..51d4ca2 100644
--- a/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
+++ b/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
@@ -21,6 +21,7 @@ package org.apache.ftpserver;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.util.Collections;
 
 import org.apache.ftpserver.impl.DefaultDataConnectionConfiguration;
 import org.apache.ftpserver.impl.PassivePorts;
@@ -48,7 +49,7 @@ public class DataConnectionConfigurationFactory {
     
     private String passiveAddress;
     private String passiveExternalAddress;
-    private PassivePorts passivePorts = new PassivePorts(new int[] { 0 }, true);
+    private PassivePorts passivePorts = new PassivePorts(Collections.<Integer>emptySet(), true);
     private boolean passiveIpCheck = false;
     private boolean implicitSsl;
 

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/4907aac4/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java b/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
index 19585ec..4d00f12 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
@@ -22,10 +22,15 @@ package org.apache.ftpserver.impl;
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Random;
+import java.util.Set;
 import java.util.StringTokenizer;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 /**
  * <strong>Internal class, do not use directly.</strong>
  * 
@@ -36,18 +41,22 @@ import java.util.StringTokenizer;
  */
 public class PassivePorts {
 
+    private Logger log = LoggerFactory.getLogger(PassivePorts.class);
+
     private static final int MAX_PORT = 65535;
 
     private static final Integer MAX_PORT_INTEGER = Integer.valueOf(MAX_PORT);
 
-    private int[] passivePorts;
+    private List<Integer> freeList;
+
+    private Set<Integer> usedList;
 
-    private boolean[] reservedPorts;
+    private Random r = new Random();
 
     private String passivePortsString;
 
     private boolean checkIfBound;
-    
+
     /**
      * Parse a string containing passive ports
      * 
@@ -57,13 +66,13 @@ public class PassivePorts {
      *            123,124,125) or ranges of ports, including open ended ranges
      *            (e.g. 123-125, 30000-, -1023). Combinations for single ports
      *            and ranges is also supported.
-     * @return An int[] array based on the parsed string
+     * @return A list of Integer objects, based on the parsed string
      * @throws IllegalArgumentException
      *             If any of of the ports in the string is invalid (e.g. not an
      *             integer or too large for a port number)
      */
-    private static int[] parse(final String portsString) {
-        List<Integer> passivePortsList = new ArrayList<Integer>();
+    private static Set<Integer> parse(final String portsString) {
+        Set<Integer> passivePortsList = new HashSet<Integer>();
 
         boolean inRange = false;
         Integer lastPort = Integer.valueOf(1);
@@ -86,7 +95,7 @@ public class PassivePorts {
             } else {
                 Integer port = Integer.valueOf(token);
 
-                verifyPort(port.intValue());
+                verifyPort(port);
 
                 if (inRange) {
                     // add all numbers from last int
@@ -105,26 +114,14 @@ public class PassivePorts {
             fillRange(passivePortsList, lastPort, MAX_PORT_INTEGER);
         }
 
-        int[] passivePorts = new int[passivePortsList.size()];
-
-        Iterator<Integer> iter = passivePortsList.iterator();
-
-        int counter = 0;
-        while (iter.hasNext()) {
-            Integer port = iter.next();
-            passivePorts[counter] = port.intValue();
-            counter++;
-        }
-
-        return passivePorts;
+        return passivePortsList;
     }
 
     /**
      * Fill a range of ports
      */
-    private static void fillRange(final List<Integer> passivePortsList,
-            final Integer beginPort, final Integer endPort) {
-        for (int i = beginPort.intValue(); i <= endPort.intValue(); i++) {
+    private static void fillRange(final Set<Integer> passivePortsList, final Integer beginPort, final Integer endPort) {
+        for (int i = beginPort; i <= endPort; i++) {
             addPort(passivePortsList, Integer.valueOf(i));
         }
     }
@@ -132,11 +129,8 @@ public class PassivePorts {
     /**
      * Add a single port if not already in list
      */
-    private static void addPort(final List<Integer> passivePortsList,
-            final Integer rangePort) {
-        if (!passivePortsList.contains(rangePort)) {
-            passivePortsList.add(rangePort);
-        }
+    private static void addPort(final Set<Integer> passivePortsList, final Integer port) {
+        passivePortsList.add(port);
     }
 
     /**
@@ -144,8 +138,7 @@ public class PassivePorts {
      */
     private static void verifyPort(final int port) {
         if (port < 0) {
-            throw new IllegalArgumentException("Port can not be negative: "
-                    + port);
+            throw new IllegalArgumentException("Port can not be negative: " + port);
         } else if (port > MAX_PORT) {
             throw new IllegalArgumentException("Port too large: " + port);
         }
@@ -157,14 +150,17 @@ public class PassivePorts {
         this.passivePortsString = passivePorts;
     }
 
-    public PassivePorts(final int[] passivePorts, boolean checkIfBound) {
-    	if(passivePorts == null) {
-    		throw new NullPointerException("passivePorts can not be null");
-    	}
-    	
-        this.passivePorts = passivePorts.clone();
+    public PassivePorts(Set<Integer> passivePorts, boolean checkIfBound) {
+        if (passivePorts == null) {
+            throw new NullPointerException("passivePorts can not be null");
+        } else if(passivePorts.isEmpty()) {
+        	passivePorts = new HashSet<Integer>();
+        	passivePorts.add(0);
+        }
+
+        this.freeList = new ArrayList<Integer>(passivePorts);
+        this.usedList = new HashSet<Integer>(passivePorts.size());
 
-        reservedPorts = new boolean[passivePorts.length];
         this.checkIfBound = checkIfBound;
     }
 
@@ -173,15 +169,15 @@ public class PassivePorts {
      */
     private boolean checkPortUnbound(int port) {
         // is this check disabled?
-        if(!checkIfBound) {
+        if (!checkIfBound) {
             return true;
         }
-        
+
         // if using 0 port, it will always be available
-        if(port == 0) {
+        if (port == 0) {
             return true;
         }
-        
+
         ServerSocket ss = null;
         try {
             ss = new ServerSocket(port);
@@ -191,7 +187,7 @@ public class PassivePorts {
             // port probably in use, check next
             return false;
         } finally {
-            if(ss != null) {
+            if (ss != null) {
                 try {
                     ss.close();
                 } catch (IOException e) {
@@ -201,27 +197,49 @@ public class PassivePorts {
             }
         }
     }
-    
-    public int reserveNextPort() {
-        // search for a free port
-        for (int i = 0; i < passivePorts.length; i++) {
-            if (!reservedPorts[i] && checkPortUnbound(passivePorts[i])) {
-                if (passivePorts[i] != 0) {
-                    reservedPorts[i] = true;
-                }
-                return passivePorts[i];
+
+    public synchronized int reserveNextPort() {
+    	// create a copy of the free ports, so that we can keep track of the tested ports
+    	List<Integer> freeCopy = new ArrayList<Integer>(freeList);
+    	
+        // Loop until we have found a port, or exhausted all available ports
+        while (freeCopy.size() > 0) {
+            // Otherwise, pick one at random
+            int i = r.nextInt(freeCopy.size());
+            Integer ret = freeCopy.get(i);
+
+            if (ret == 0) {
+                // "Any" port should not be removed from our free list,
+                // nor added to the used list
+                return 0;
+
+            } else if (checkPortUnbound(ret)) {
+                // Not used by someone else, so lets reserve it and return it
+                freeList.remove(i);
+                usedList.add(ret);
+                return ret;
+
+            } else {
+            	freeCopy.remove(i);
+                // log port unavailable, but left in pool
+                log.warn("Passive port in use by another process: " + ret);
             }
         }
 
         return -1;
     }
 
-    public void releasePort(final int port) {
-        for (int i = 0; i < passivePorts.length; i++) {
-            if (passivePorts[i] == port) {
-                reservedPorts[i] = false;
-                break;
-            }
+    public synchronized void releasePort(final int port) {
+        if (port == 0) {
+            // Ignore port 0 being released,
+            // since its not put on the used list
+
+        } else if (usedList.remove(port)) {
+            freeList.add(port);
+
+        } else {
+            // log attempt to release unused port
+            log.warn("Releasing unreserved passive port: " + port);
         }
     }
 
@@ -233,7 +251,7 @@ public class PassivePorts {
 
         StringBuilder sb = new StringBuilder();
 
-        for (int port : passivePorts) {
+        for (Integer port : freeList) {
             sb.append(port);
             sb.append(",");
         }

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/4907aac4/core/src/test/java/org/apache/ftpserver/clienttests/PasvUsedPortTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/clienttests/PasvUsedPortTest.java b/core/src/test/java/org/apache/ftpserver/clienttests/PasvUsedPortTest.java
index 0049242..ab3635b 100644
--- a/core/src/test/java/org/apache/ftpserver/clienttests/PasvUsedPortTest.java
+++ b/core/src/test/java/org/apache/ftpserver/clienttests/PasvUsedPortTest.java
@@ -68,10 +68,5 @@ public class PasvUsedPortTest extends ClientTestTemplate {
 
         // close blocking socket
         ss.close();
-        
-        client.connect("localhost", getListenerPort());
-        client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
-        client.pasv();
-        assertEquals("227 Entering Passive Mode (127,0,0,1,48,156)", client.getReplyString().trim());
     }
 }

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/4907aac4/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java b/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java
index 1167e20..3c48944 100644
--- a/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java
+++ b/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java
@@ -19,6 +19,12 @@
 
 package org.apache.ftpserver.impl;
 
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 
 /**
@@ -69,146 +75,109 @@ public class PassivePortsTest extends TestCase {
             // ok
         }
     }
+    
+    private void assertContains( List<Integer> valid, Integer testVal ){
+        if( !valid.remove(testVal) ){
+            throw new AssertionFailedError( "Did not find "+testVal+" in valid list "+valid );
+        }
+    }
+    
+    private void assertReserveAll(String portString, int... validPorts) {
+    	PassivePorts ports = new PassivePorts(portString, false);
+    	
+        List<Integer> valid = valid(validPorts);
 
-    public void testParseListOfValues() {
-        PassivePorts ports = new PassivePorts("123, 456,\t\n789", false);
-
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(456, ports.reserveNextPort());
-        assertEquals(789, ports.reserveNextPort());
+        int len = valid.size();
+        for(int i = 0; i<len; i++) {
+        	assertContains(valid, ports.reserveNextPort());
+        }
         assertEquals(-1, ports.reserveNextPort());
-    }
+        assertTrue(valid.isEmpty());
 
-    public void testParseListOfValuesOrder() {
-        PassivePorts ports = new PassivePorts("123, 789, 456", false);
+    }
+    
+    private List<Integer> valid(int... ints) {
+        List<Integer> valid = new ArrayList<Integer>();
+        for(int i : ints) {
+        	valid.add(i);
+        }
+        return valid;
+    }
 
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(789, ports.reserveNextPort());
-        assertEquals(456, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+    public void testParseListOfValues() {
+        assertReserveAll("123, 456,\t\n789", 123, 456, 789);
     }
 
     public void testParseListOfValuesDuplicate() {
-        PassivePorts ports = new PassivePorts("123, 789, 456, 789", false);
-
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(789, ports.reserveNextPort());
-        assertEquals(456, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("123, 789, 456, 789", 123, 456, 789);
     }
 
     public void testParseSimpleRange() {
-        PassivePorts ports = new PassivePorts("123-125", false);
-
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(124, ports.reserveNextPort());
-        assertEquals(125, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("123-125", 123, 124, 125);
     }
 
     public void testParseMultipleRanges() {
-        PassivePorts ports = new PassivePorts("123-125, 127-128, 130-132", false);
-
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(124, ports.reserveNextPort());
-        assertEquals(125, ports.reserveNextPort());
-        assertEquals(127, ports.reserveNextPort());
-        assertEquals(128, ports.reserveNextPort());
-        assertEquals(130, ports.reserveNextPort());
-        assertEquals(131, ports.reserveNextPort());
-        assertEquals(132, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("123-125, 127-128, 130-132", 123, 124, 125, 127, 128, 130, 131, 132);
     }
 
     public void testParseMixedRangeAndSingle() {
-        PassivePorts ports = new PassivePorts("123-125, 126, 128-129", false);
-
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(124, ports.reserveNextPort());
-        assertEquals(125, ports.reserveNextPort());
-        assertEquals(126, ports.reserveNextPort());
-        assertEquals(128, ports.reserveNextPort());
-        assertEquals(129, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("123-125, 126, 128-129", 123, 124, 125, 126, 128, 129);
     }
 
     public void testParseOverlapingRanges() {
-        PassivePorts ports = new PassivePorts("123-125, 124-126", false);
-
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(124, ports.reserveNextPort());
-        assertEquals(125, ports.reserveNextPort());
-        assertEquals(126, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("123-125, 124-126", 123, 124, 125, 126);
     }
 
     public void testParseOverlapingRangesorder() {
-        PassivePorts ports = new PassivePorts("124-126, 123-125", false);
-
-        assertEquals(124, ports.reserveNextPort());
-        assertEquals(125, ports.reserveNextPort());
-        assertEquals(126, ports.reserveNextPort());
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("124-126, 123-125", 123, 124, 125, 126);
     }
 
     public void testParseOpenLowerRange() {
-        PassivePorts ports = new PassivePorts("9, -3", false);
-
-        assertEquals(9, ports.reserveNextPort());
-        assertEquals(1, ports.reserveNextPort());
-        assertEquals(2, ports.reserveNextPort());
-        assertEquals(3, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("9, -3", 1, 2, 3, 9);
     }
 
     public void testParseOpenUpperRange() {
-        PassivePorts ports = new PassivePorts("65533-", false);
-
-        assertEquals(65533, ports.reserveNextPort());
-        assertEquals(65534, ports.reserveNextPort());
-        assertEquals(65535, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("65533-", 65533, 65534, 65535);
     }
 
     public void testParseOpenUpperRange3() {
-        PassivePorts ports = new PassivePorts("65533-, 65532-", false);
-
-        assertEquals(65533, ports.reserveNextPort());
-        assertEquals(65534, ports.reserveNextPort());
-        assertEquals(65535, ports.reserveNextPort());
-        assertEquals(65532, ports.reserveNextPort());
-        assertEquals(-1, ports.reserveNextPort());
+        assertReserveAll("65533-, 65532-", 65532, 65533, 65534, 65535);
     }
 
     public void testParseOpenUpperRange2() {
-        PassivePorts ports = new PassivePorts("65533-, 1", false);
+        assertReserveAll("65533-, 1", 1, 65533, 65534, 65535);
+    }
+    
+    public void testReserveNextPortBound() throws IOException {
+    	ServerSocket ss = new ServerSocket(0);
+    	
+        PassivePorts ports = new PassivePorts(Integer.toString(ss.getLocalPort()), true);
 
-        assertEquals(65533, ports.reserveNextPort());
-        assertEquals(65534, ports.reserveNextPort());
-        assertEquals(65535, ports.reserveNextPort());
-        assertEquals(1, ports.reserveNextPort());
         assertEquals(-1, ports.reserveNextPort());
+        
+        ss.close();
+        
+        assertEquals(ss.getLocalPort(), ports.reserveNextPort());
     }
 
+
     public void testParseRelease() {
         PassivePorts ports = new PassivePorts("123, 456,789", false);
 
-        assertEquals(123, ports.reserveNextPort());
-        assertEquals(456, ports.reserveNextPort());
-        ports.releasePort(456);
-        assertEquals(456, ports.reserveNextPort());
+        List<Integer> valid = valid(123, 456, 789);
+
+        assertContains(valid, ports.reserveNextPort());
+
+        int port = ports.reserveNextPort();
+        assertContains(valid, port);
+        ports.releasePort(port);
+        valid.add(port);
+        assertContains(valid, ports.reserveNextPort());
+        
+        assertContains(valid, ports.reserveNextPort());
 
-        assertEquals(789, ports.reserveNextPort());
         assertEquals(-1, ports.reserveNextPort());
+        assertEquals(0, valid.size());
     }
 
-    public void testNullPorts() {
-    	try {
-    		new PassivePorts((int[])null, false);
-    		fail("Must throw NPE");
-    	} catch(NullPointerException e) {
-    		// ok
-    	}
-    }
-}
+}
\ No newline at end of file


[42/50] [abbrv] git commit: FTPSERVER-375 - use canonicalPath rather than File to implement equals and hashcode

Posted by ng...@apache.org.
FTPSERVER-375 - use canonicalPath rather than File to implement equals and hashcode

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1138635 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/46484938
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/46484938
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/46484938

Branch: refs/heads/trunk
Commit: 46484938383bf5a78dc9f5311d2e926f6f4e1860
Parents: 25e4d86
Author: Sebastian Bazley <se...@apache.org>
Authored: Wed Jun 22 21:08:23 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Wed Jun 22 21:08:23 2011 +0000

----------------------------------------------------------------------
 .../filesystem/nativefs/impl/NativeFtpFile.java   | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/46484938/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
index 4052ff6..3d1bf3c 100644
--- a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
+++ b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
@@ -394,21 +394,25 @@ public class NativeFtpFile implements FtpFile {
         };
     }
 
+    /**
+     * Implements equals by comparing getCanonicalPath() for the underlying file instabnce.
+     * Ignores the fileName and User fields
+     */
     @Override
     public boolean equals(Object obj) {
         if (obj instanceof NativeFtpFile) {
-            File thisCanonicalFile;
-            File otherCanonicalFile;
+            String thisCanonicalPath;
+            String otherCanonicalPath;
             try {
-                thisCanonicalFile = this.file.getCanonicalFile();
-                otherCanonicalFile = ((NativeFtpFile) obj).file
-                        .getCanonicalFile();
+                thisCanonicalPath = this.file.getCanonicalPath();
+                otherCanonicalPath = ((NativeFtpFile) obj).file
+                        .getCanonicalPath();
             } catch (IOException e) {
                 throw new RuntimeException("Failed to get the canonical path",
                         e);
             }
 
-            return thisCanonicalFile.equals(otherCanonicalFile);
+            return thisCanonicalPath.equals(otherCanonicalPath);
         }
         return false;
     }
@@ -416,7 +420,7 @@ public class NativeFtpFile implements FtpFile {
 	@Override
 	public int hashCode() {
 		try {
-			return file.getCanonicalFile().hashCode();
+			return file.getCanonicalPath().hashCode();
 		} catch (IOException e) {
 			return 0;
 		}


[47/50] [abbrv] git commit: Correctly set the data connection as protected when using AUTH SSL

Posted by ng...@apache.org.
Correctly set the data connection as protected when using AUTH SSL

Fixes FTPSERVER-431

Also adds support for the TLS-C and TLS-P auth types

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1332855 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/7defa046
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/7defa046
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/7defa046

Branch: refs/heads/trunk
Commit: 7defa046ecab70f76568232c9f9504e26a101a74
Parents: ba0962b
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Tue May 1 21:52:58 2012 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Tue May 1 21:52:58 2012 +0000

----------------------------------------------------------------------
 .../java/org/apache/ftpserver/command/impl/AUTH.java     | 11 ++++++++++-
 .../ftpserver/ssl/ExplicitSecurityTestTemplate.java      |  7 +++++++
 .../ftpserver/ssl/MinaImplicitDataChannelTest.java       |  4 ++++
 3 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/7defa046/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java b/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
index 06e030c..070ef48 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
@@ -50,7 +50,7 @@ public class AUTH extends AbstractCommand {
 
     private final Logger LOG = LoggerFactory.getLogger(AUTH.class);
 
-    private static final List<String> VALID_AUTH_TYPES = Arrays.asList("SSL", "TLS");
+    private static final List<String> VALID_AUTH_TYPES = Arrays.asList("SSL", "TLS", "TLS-C", "TLS-P");
 
     /**
      * Execute command
@@ -100,6 +100,12 @@ public class AUTH extends AbstractCommand {
         // check parameter
         String authType = request.getArgument().toUpperCase();
         if (VALID_AUTH_TYPES.contains(authType)) {
+            if(authType.equals("TLS-C")) {
+                authType = "TLS";
+            } else if(authType.equals("TLS-P")) {
+                authType = "SSL";
+            }
+
             try {
                 secureSession(session, authType);
                 session.write(LocalizedFtpReply.translate(session, request, context,
@@ -141,6 +147,9 @@ public class AUTH extends AbstractCommand {
             session.getFilterChain().addFirst(SSL_SESSION_FILTER_NAME,
                     sslFilter);
 
+            if("SSL".equals(type)) {
+                session.getDataConnection().setSecure(true);
+            }
         } else {
             throw new FtpException("Socket factory SSL not configured");
         }

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/7defa046/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java b/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java
index a8bd82d..69b0df0 100644
--- a/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java
+++ b/core/src/test/java/org/apache/ftpserver/ssl/ExplicitSecurityTestTemplate.java
@@ -47,12 +47,19 @@ public abstract class ExplicitSecurityTestTemplate extends SSLTestTemplate {
         client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
     }
 
+    protected boolean expectDataConnectionSecure() {
+        return getAuthValue().equals("SSL") && !useImplicit();
+    }
+
     /**
      * Tests that we can send command over the command channel. This is, in fact
      * already tested by login in setup but an explicit test is good anyways.
      */
     public void testCommandChannel() throws Exception {
         assertTrue(getActiveSession().isSecure());
+
+        assertEquals(expectDataConnectionSecure(), getActiveSession().getDataConnection().isSecure());
+
         assertTrue(FTPReply.isPositiveCompletion(client.noop()));
     }
 

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/7defa046/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java b/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java
index 2f34be7..e9d0355 100644
--- a/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java
+++ b/core/src/test/java/org/apache/ftpserver/ssl/MinaImplicitDataChannelTest.java
@@ -61,6 +61,10 @@ public class MinaImplicitDataChannelTest extends ImplicitSecurityTestTemplate {
         return true;
     }
 
+    protected boolean expectDataConnectionSecure() {
+        return true;
+    }
+
     /**
      * Simple test that the {@link ServerDataConnectionFactory#isSecure()} 
      * works as expected


[50/50] [abbrv] git commit: Ignore Eclipse project files

Posted by ng...@apache.org.
Ignore Eclipse project files


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/ada8bd82
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/ada8bd82
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/ada8bd82

Branch: refs/heads/trunk
Commit: ada8bd8284bf7da1b51d2ad17eb3595a561e9441
Parents: cd4e9e0
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Mon Aug 12 00:01:09 2013 +0200
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Mon Aug 12 00:14:51 2013 +0200

----------------------------------------------------------------------
 .gitignore | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/ada8bd82/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4d7b35b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+.project
+.classpath
+.settings
+target


[48/50] [abbrv] git commit: Fix for broken OSGi packages (FTPSERVER-425)

Posted by ng...@apache.org.
Fix for broken OSGi packages (FTPSERVER-425)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1385165 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/c39b8226
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/c39b8226
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/c39b8226

Branch: refs/heads/trunk
Commit: c39b8226f98328fac7dd897b03712fa11e5ca97a
Parents: 7defa04
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Sat Sep 15 20:34:47 2012 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Sat Sep 15 20:34:47 2012 +0000

----------------------------------------------------------------------
 core/pom.xml | 10 ----------
 1 file changed, 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/c39b8226/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 779fc47..6291a3f 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -79,16 +79,6 @@
 							org.apache.ftpserver.ssl;version=${project.version},
 							org.apache.ftpserver.usermanager;version=${project.version}
 						</Export-Package>
-						<Private-Package> org.apache.ftpserver.command.impl,
-							org.apache.ftpserver.command.impl.listing,
-							org.apache.ftpserver.filesystem.nativefs.impl,
-							org.apache.ftpserver.ftpletcontainer.impl,
-							org.apache.ftpserver.impl, org.apache.ftpserver.listener.nio,
-							org.apache.ftpserver.message.impl, org.apache.ftpserver.ssl.impl,
-							org.apache.ftpserver.usermanager.impl,
-							org.apache.ftpserver.util,
-							org.apache.ftpserver.*
-						</Private-Package>
 						<Import-Package>
 							org.springframework.beans.factory.config;resolution:=optional;version="2.5",
 							org.springframework.beans.factory.support;resolution:=optional;version="2.5",


[27/50] [abbrv] git commit: Tidy up test (no need for output)

Posted by ng...@apache.org.
Tidy up test (no need for output)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129953 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/a3d156c9
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/a3d156c9
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/a3d156c9

Branch: refs/heads/trunk
Commit: a3d156c92527ca8395ce2fe1e6cd84a1d408e5a2
Parents: 80a0159
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 22:51:57 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 22:51:57 2011 +0000

----------------------------------------------------------------------
 .../ftpserver/clienttests/BindExceptionSerialTest.java   | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/a3d156c9/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java b/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java
index 2ac6269..2ca5f0b 100644
--- a/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java
+++ b/core/src/test/java/org/apache/ftpserver/clienttests/BindExceptionSerialTest.java
@@ -55,14 +55,7 @@ public class BindExceptionSerialTest extends ClientTestTemplate {
     }
 
     public void testSerialExecution() throws Exception {
-        try {
-            System.out.println("-- call one");
-            System.out.println(Arrays.asList(client.listFiles()));
-            System.out.println("-- call two");
-            System.out.println(Arrays.asList(client.listFiles()));
-        } catch (IOException e) {
-            e.printStackTrace();
-            fail();
-        }
+        assertNotNull(client.listFiles());
+        assertNotNull(client.listFiles());
     }
 }
\ No newline at end of file


[46/50] [abbrv] git commit: Remove duplicate code

Posted by ng...@apache.org.
Remove duplicate code

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1332847 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/ba0962b9
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/ba0962b9
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/ba0962b9

Branch: refs/heads/trunk
Commit: ba0962b9c0ba5152e15104be213b6ea80d63344e
Parents: 18c6424
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Tue May 1 21:45:04 2012 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Tue May 1 21:45:04 2012 +0000

----------------------------------------------------------------------
 .../org/apache/ftpserver/command/impl/AUTH.java | 21 +++++++-------------
 1 file changed, 7 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/ba0962b9/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java b/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
index acc8827..06e030c 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/AUTH.java
@@ -21,6 +21,8 @@ package org.apache.ftpserver.command.impl;
 
 import java.io.IOException;
 import java.security.GeneralSecurityException;
+import java.util.Arrays;
+import java.util.List;
 
 import org.apache.ftpserver.command.AbstractCommand;
 import org.apache.ftpserver.ftplet.FtpException;
@@ -48,6 +50,8 @@ public class AUTH extends AbstractCommand {
 
     private final Logger LOG = LoggerFactory.getLogger(AUTH.class);
 
+    private static final List<String> VALID_AUTH_TYPES = Arrays.asList("SSL", "TLS");
+
     /**
      * Execute command
      */
@@ -95,22 +99,11 @@ public class AUTH extends AbstractCommand {
 
         // check parameter
         String authType = request.getArgument().toUpperCase();
-        if (authType.equals("SSL")) {
-            try {
-                secureSession(session, "SSL");
-                session.write(LocalizedFtpReply.translate(session, request, context,
-                        234, "AUTH.SSL", null));
-            } catch (FtpException ex) {
-                throw ex;
-            } catch (Exception ex) {
-                LOG.warn("AUTH.execute()", ex);
-                throw new FtpException("AUTH.execute()", ex);
-            }
-        } else if (authType.equals("TLS")) {
+        if (VALID_AUTH_TYPES.contains(authType)) {
             try {
-                secureSession(session, "TLS");
+                secureSession(session, authType);
                 session.write(LocalizedFtpReply.translate(session, request, context,
-                        234, "AUTH.TLS", null));
+                        234, "AUTH." + authType, null));
             } catch (FtpException ex) {
                 throw ex;
             } catch (Exception ex) {


[26/50] [abbrv] git commit: Avoid [WARNING] Using platform encoding

Posted by ng...@apache.org.
Avoid [WARNING] Using platform encoding

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129848 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/80a0159a
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/80a0159a
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/80a0159a

Branch: refs/heads/trunk
Commit: 80a0159a3812e155a0258dafd5b14ff7a0c2615a
Parents: 358f8e6
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 18:53:14 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 18:53:14 2011 +0000

----------------------------------------------------------------------
 pom.xml | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/80a0159a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6ab0f5a..de996fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -453,5 +453,6 @@
     <maven.compile.source>1.5</maven.compile.source>
     <maven.compile.target>1.5</maven.compile.target>
     <ftpserver.version>${project.version}</ftpserver.version>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
   </properties>
 </project>


[15/50] [abbrv] git commit: Javadoc

Posted by ng...@apache.org.
Javadoc

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129760 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/03b260ea
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/03b260ea
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/03b260ea

Branch: refs/heads/trunk
Commit: 03b260ea7cd64352e3bf10b9d972e525522c6970
Parents: 0ccd7f0
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:31:24 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:31:24 2011 +0000

----------------------------------------------------------------------
 core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/03b260ea/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java b/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
index 7ca881f..7926178 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
@@ -55,7 +55,7 @@ public class PassivePorts {
      *            123,124,125) or ranges of ports, including open ended ranges
      *            (e.g. 123-125, 30000-, -1023). Combinations for single ports
      *            and ranges is also supported.
-     * @return An instance of {@link PassivePorts} based on the parsed string
+     * @return An int[] array based on the parsed string
      * @throws IllegalArgumentException
      *             If any of of the ports in the string is invalid (e.g. not an
      *             integer or too large for a port number)


[34/50] [abbrv] git commit: Doing an explicit null check in PassivePorts (FTPSERVER-415)

Posted by ng...@apache.org.
Doing an explicit null check in PassivePorts (FTPSERVER-415)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1130138 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/e09a4321
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/e09a4321
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/e09a4321

Branch: refs/heads/trunk
Commit: e09a4321596953185e980396a5353e1631497b43
Parents: 75f7e60
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Wed Jun 1 13:07:00 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Wed Jun 1 13:07:00 2011 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/ftpserver/impl/PassivePorts.java | 10 +++++-----
 .../java/org/apache/ftpserver/impl/PassivePortsTest.java  |  8 ++++++++
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/e09a4321/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java b/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
index f539540..19585ec 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
@@ -158,11 +158,11 @@ public class PassivePorts {
     }
 
     public PassivePorts(final int[] passivePorts, boolean checkIfBound) {
-        if (passivePorts != null) {
-            this.passivePorts = passivePorts.clone();
-        } else {
-            this.passivePorts = null;
-        }
+    	if(passivePorts == null) {
+    		throw new NullPointerException("passivePorts can not be null");
+    	}
+    	
+        this.passivePorts = passivePorts.clone();
 
         reservedPorts = new boolean[passivePorts.length];
         this.checkIfBound = checkIfBound;

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/e09a4321/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java b/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java
index 57021de..1167e20 100644
--- a/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java
+++ b/core/src/test/java/org/apache/ftpserver/impl/PassivePortsTest.java
@@ -203,4 +203,12 @@ public class PassivePortsTest extends TestCase {
         assertEquals(-1, ports.reserveNextPort());
     }
 
+    public void testNullPorts() {
+    	try {
+    		new PassivePorts((int[])null, false);
+    		fail("Must throw NPE");
+    	} catch(NullPointerException e) {
+    		// ok
+    	}
+    }
 }


[32/50] [abbrv] git commit: Use ERROR, as WARN still generates lots of output

Posted by ng...@apache.org.
Use ERROR, as WARN still generates lots of output

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1130119 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/341367b7
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/341367b7
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/341367b7

Branch: refs/heads/trunk
Commit: 341367b7c6af855870fa140f63bc19af0b54919a
Parents: baa2fd8
Author: Sebastian Bazley <se...@apache.org>
Authored: Wed Jun 1 12:05:18 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Wed Jun 1 12:05:18 2011 +0000

----------------------------------------------------------------------
 core/src/test/resources/log4j.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/341367b7/core/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/log4j.properties b/core/src/test/resources/log4j.properties
index bbe7336..ad7e71c 100644
--- a/core/src/test/resources/log4j.properties
+++ b/core/src/test/resources/log4j.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-log4j.rootLogger=WARN, C 
+log4j.rootLogger=ERROR, C 
 log4j.appender.C=org.apache.log4j.ConsoleAppender 
 log4j.appender.C.layout=org.apache.log4j.PatternLayout 
 log4j.appender.C.layout.ConversionPattern=[%X{userName}] [%X{remoteIp}] [%X{session}] %m%n


[44/50] [abbrv] git commit: Upgrading to latest Apache parent POM and the latest bundle Maven plugin to have the build deploy to repository.a.o

Posted by ng...@apache.org.
Upgrading to latest Apache parent POM and the latest bundle Maven plugin to have the build deploy to repository.a.o

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1140171 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/943dc8e5
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/943dc8e5
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/943dc8e5

Branch: refs/heads/trunk
Commit: 943dc8e54a6df7382c766a03ed1c0572a3c26bc3
Parents: d9528dd
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Mon Jun 27 14:10:27 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Mon Jun 27 14:10:27 2011 +0000

----------------------------------------------------------------------
 core/pom.xml                                   |  2 +-
 examples/ftpserver-osgi-ftplet-service/pom.xml |  2 +-
 examples/ftpserver-osgi-spring-service/pom.xml |  2 +-
 ftplet-api/pom.xml                             |  2 +-
 pom.xml                                        | 38 ++-------------------
 5 files changed, 6 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/943dc8e5/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index 34de129..779fc47 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -61,7 +61,7 @@
 			<plugin>
 				<groupId>org.apache.felix</groupId>
 				<artifactId>maven-bundle-plugin</artifactId>
-				<version>1.4.1</version>
+				<version>2.3.4</version>
 				<extensions>true</extensions>
 				<configuration>
 					<instructions>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/943dc8e5/examples/ftpserver-osgi-ftplet-service/pom.xml
----------------------------------------------------------------------
diff --git a/examples/ftpserver-osgi-ftplet-service/pom.xml b/examples/ftpserver-osgi-ftplet-service/pom.xml
index 744139b..cf2b2bb 100644
--- a/examples/ftpserver-osgi-ftplet-service/pom.xml
+++ b/examples/ftpserver-osgi-ftplet-service/pom.xml
@@ -48,7 +48,7 @@
 			<plugin>
 				<groupId>org.apache.felix</groupId>
 				<artifactId>maven-bundle-plugin</artifactId>
-				<version>1.4.1</version>
+				<version>2.3.4</version>
 				<extensions>true</extensions>
 				<configuration>
 					<instructions>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/943dc8e5/examples/ftpserver-osgi-spring-service/pom.xml
----------------------------------------------------------------------
diff --git a/examples/ftpserver-osgi-spring-service/pom.xml b/examples/ftpserver-osgi-spring-service/pom.xml
index ac09959..378f552 100644
--- a/examples/ftpserver-osgi-spring-service/pom.xml
+++ b/examples/ftpserver-osgi-spring-service/pom.xml
@@ -42,7 +42,7 @@
 			<plugin>
 				<groupId>org.apache.felix</groupId>
 				<artifactId>maven-bundle-plugin</artifactId>
-				<version>1.4.1</version>
+				<version>2.3.4</version>
 				<extensions>true</extensions>
 				<configuration>
 					<instructions>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/943dc8e5/ftplet-api/pom.xml
----------------------------------------------------------------------
diff --git a/ftplet-api/pom.xml b/ftplet-api/pom.xml
index c460b2d..7c0bdcc 100644
--- a/ftplet-api/pom.xml
+++ b/ftplet-api/pom.xml
@@ -49,7 +49,7 @@
 			<plugin>
 				<groupId>org.apache.felix</groupId>
 				<artifactId>maven-bundle-plugin</artifactId>
-				<version>1.4.1</version>
+				<version>2.3.4</version>
 				<extensions>true</extensions>
 				<configuration>
 					<instructions>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/943dc8e5/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 471c389..61260b7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
   <parent>
     <artifactId>apache</artifactId>
     <groupId>org.apache</groupId>
-    <version>4</version>
+    <version>9</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.ftpserver</groupId>
@@ -342,23 +342,10 @@
 
   <profiles>
     <profile>
-      <id>release</id>
+      <id>apache-release</id>
       <build>
         <plugins>
           <plugin>
-            <artifactId>maven-gpg-plugin</artifactId>
-            <version>1.0-alpha-4</version>
-            <executions>
-              <execution>
-                <id>sign-artifacts</id>
-                <phase>verify</phase>
-                <goals>
-                  <goal>sign</goal>
-                </goals>
-              </execution>
-            </executions>
-          </plugin>
-          <plugin>
             <artifactId>maven-javadoc-plugin</artifactId>
             <version>2.5</version>
             <executions>
@@ -413,13 +400,6 @@
         <module>distribution</module>
         <module>examples</module>
       </modules>
-      <distributionManagement>
-        <repository>
-          <id>apache.releases</id>
-          <name>Apache Release Distribution Repository</name>
-          <url>scpexe://people.apache.org/www/people.apache.org/repo/m2-ibiblio-rsync-repository</url>
-        </repository>
-      </distributionManagement>
     </profile>
   </profiles>
 
@@ -429,20 +409,6 @@
     <module>examples</module>
   </modules>
 
-  <distributionManagement>
-    <repository>
-      <id>dummy</id>
-      <name>Dummy to avoid accidental deploys</name>
-      <url/>
-    </repository>
-    <snapshotRepository>
-      <id>apache.snapshots.https</id>
-      <name>Apache Development Snapshot Repository</name>
-      <url>https://repository.apache.org/content/repositories/snapshots</url>
-      <uniqueVersion>false</uniqueVersion>
-    </snapshotRepository>
-  </distributionManagement>
-
   <properties>
     <maven.compile.source>1.5</maven.compile.source>
     <maven.compile.target>1.5</maven.compile.target>


[29/50] [abbrv] git commit: JUnit => 4.8.2 Surefire => 2.8.1

Posted by ng...@apache.org.
JUnit => 4.8.2
Surefire => 2.8.1

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1130113 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/5f980c73
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/5f980c73
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/5f980c73

Branch: refs/heads/trunk
Commit: 5f980c73cdf2ca2f19d6652988d2babdafa7004c
Parents: 7ee2936
Author: Sebastian Bazley <se...@apache.org>
Authored: Wed Jun 1 11:57:53 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Wed Jun 1 11:57:53 2011 +0000

----------------------------------------------------------------------
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5f980c73/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fd32f44..a9f5a84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -186,7 +186,7 @@
       <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
-        <version>3.8.2</version>
+        <version>4.8.2</version>
       </dependency>
  
       <dependency>
@@ -247,7 +247,7 @@
 
       <plugin>
         <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.4.3</version>
+        <version>2.8.1</version>
       </plugin>
 
       <plugin>


[23/50] [abbrv] Fix eol-style

Posted by ng...@apache.org.
http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/test/java/org/apache/ftpserver/commands/impl/listing/DirectoryListerTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/commands/impl/listing/DirectoryListerTest.java b/core/src/test/java/org/apache/ftpserver/commands/impl/listing/DirectoryListerTest.java
index 25882f4..f3b33c1 100644
--- a/core/src/test/java/org/apache/ftpserver/commands/impl/listing/DirectoryListerTest.java
+++ b/core/src/test/java/org/apache/ftpserver/commands/impl/listing/DirectoryListerTest.java
@@ -1,104 +1,104 @@
-/*
- * 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.ftpserver.commands.impl.listing;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.apache.ftpserver.command.impl.listing.DirectoryLister;
-import org.apache.ftpserver.command.impl.listing.FileFormater;
-import org.apache.ftpserver.command.impl.listing.ListArgument;
-import org.apache.ftpserver.command.impl.listing.NLSTFileFormater;
-import org.apache.ftpserver.filesystem.nativefs.impl.NativeFileSystemView;
-import org.apache.ftpserver.ftplet.FileSystemView;
-import org.apache.ftpserver.test.TestUtil;
-import org.apache.ftpserver.usermanager.impl.BaseUser;
-import org.apache.ftpserver.util.IoUtils;
-
-/**
-*
-* @author <a href="http://mina.apache.org">Apache MINA Project</a>
-*
-*/
-public class DirectoryListerTest extends TestCase {
-    private static final File TEST_TMP_DIR = new File("test-tmp");
-
-    protected static final File ROOT_DIR = new File(TEST_TMP_DIR, "ftproot");
-
-    private static final File TEST_FILE1 = new File(ROOT_DIR, "test1.txt");
-
-    private static final File TEST_DIR1 = new File(ROOT_DIR, "dir1");
-
-    private static final File TEST_DIR2 = new File(ROOT_DIR, "dir2");
-
-    private static final File TEST_FILE1_IN_DIR1 = new File(TEST_DIR1,
-            "test3.txt");
-
-    private static final File TEST_FILE2_IN_DIR1 = new File(TEST_DIR1,
-            "test4.txt");
-
-    private static final File TEST_DIR_IN_DIR1 = new File(TEST_DIR1, "dir3");
-
-    private static final byte[] TEST_DATA = "TESTDATA".getBytes();
-
-    private DirectoryLister directoryLister;
-
-    private FileSystemView fileSystemView;
-
-    @Override
-    protected void setUp() throws Exception {
-        BaseUser baseUser = new BaseUser();
-        baseUser.setHomeDirectory(ROOT_DIR.getAbsolutePath());
-        fileSystemView = new NativeFileSystemView(baseUser) {
-        };
-        directoryLister = new DirectoryLister();
-
-        assertTrue(ROOT_DIR.mkdirs());
-        assertTrue(TEST_DIR1.mkdirs());
-        assertTrue(TEST_DIR2.mkdirs());
-        TestUtil.writeDataToFile(TEST_FILE1, TEST_DATA);
-        TestUtil.writeDataToFile(TEST_FILE1_IN_DIR1, TEST_DATA);
-        TEST_FILE2_IN_DIR1.createNewFile();
-        assertTrue(TEST_DIR_IN_DIR1.mkdir());
-    }
-
-    public void testListFiles() throws Exception {
-        ListArgument arg = new ListArgument(TEST_DIR1.getName(), null, null);
-        FileFormater formater = new NLSTFileFormater();
-
-        String actual = directoryLister
-                .listFiles(arg, fileSystemView, formater);
-
-        assertEquals("dir3\r\ntest3.txt\r\ntest4.txt\r\n", actual);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see junit.framework.TestCase#tearDown()
-     */
-    @Override
-    protected void tearDown() throws Exception {
-        if (TEST_TMP_DIR.exists()) {
-            IoUtils.delete(TEST_TMP_DIR);
-        }
-    }
+/*
+ * 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.ftpserver.commands.impl.listing;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.apache.ftpserver.command.impl.listing.DirectoryLister;
+import org.apache.ftpserver.command.impl.listing.FileFormater;
+import org.apache.ftpserver.command.impl.listing.ListArgument;
+import org.apache.ftpserver.command.impl.listing.NLSTFileFormater;
+import org.apache.ftpserver.filesystem.nativefs.impl.NativeFileSystemView;
+import org.apache.ftpserver.ftplet.FileSystemView;
+import org.apache.ftpserver.test.TestUtil;
+import org.apache.ftpserver.usermanager.impl.BaseUser;
+import org.apache.ftpserver.util.IoUtils;
+
+/**
+*
+* @author <a href="http://mina.apache.org">Apache MINA Project</a>
+*
+*/
+public class DirectoryListerTest extends TestCase {
+    private static final File TEST_TMP_DIR = new File("test-tmp");
+
+    protected static final File ROOT_DIR = new File(TEST_TMP_DIR, "ftproot");
+
+    private static final File TEST_FILE1 = new File(ROOT_DIR, "test1.txt");
+
+    private static final File TEST_DIR1 = new File(ROOT_DIR, "dir1");
+
+    private static final File TEST_DIR2 = new File(ROOT_DIR, "dir2");
+
+    private static final File TEST_FILE1_IN_DIR1 = new File(TEST_DIR1,
+            "test3.txt");
+
+    private static final File TEST_FILE2_IN_DIR1 = new File(TEST_DIR1,
+            "test4.txt");
+
+    private static final File TEST_DIR_IN_DIR1 = new File(TEST_DIR1, "dir3");
+
+    private static final byte[] TEST_DATA = "TESTDATA".getBytes();
+
+    private DirectoryLister directoryLister;
+
+    private FileSystemView fileSystemView;
+
+    @Override
+    protected void setUp() throws Exception {
+        BaseUser baseUser = new BaseUser();
+        baseUser.setHomeDirectory(ROOT_DIR.getAbsolutePath());
+        fileSystemView = new NativeFileSystemView(baseUser) {
+        };
+        directoryLister = new DirectoryLister();
+
+        assertTrue(ROOT_DIR.mkdirs());
+        assertTrue(TEST_DIR1.mkdirs());
+        assertTrue(TEST_DIR2.mkdirs());
+        TestUtil.writeDataToFile(TEST_FILE1, TEST_DATA);
+        TestUtil.writeDataToFile(TEST_FILE1_IN_DIR1, TEST_DATA);
+        TEST_FILE2_IN_DIR1.createNewFile();
+        assertTrue(TEST_DIR_IN_DIR1.mkdir());
+    }
+
+    public void testListFiles() throws Exception {
+        ListArgument arg = new ListArgument(TEST_DIR1.getName(), null, null);
+        FileFormater formater = new NLSTFileFormater();
+
+        String actual = directoryLister
+                .listFiles(arg, fileSystemView, formater);
+
+        assertEquals("dir3\r\ntest3.txt\r\ntest4.txt\r\n", actual);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see junit.framework.TestCase#tearDown()
+     */
+    @Override
+    protected void tearDown() throws Exception {
+        if (TEST_TMP_DIR.exists()) {
+            IoUtils.delete(TEST_TMP_DIR);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/test/java/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java b/core/src/test/java/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
index d918e3e..cd78b4b 100644
--- a/core/src/test/java/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
+++ b/core/src/test/java/org/apache/ftpserver/ssl/MinaCipherSuitesTest.java
@@ -1,87 +1,87 @@
-/*
- * 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.ftpserver.ssl;
-
-import javax.net.ssl.SSLHandshakeException;
-
-import org.apache.commons.net.ftp.FTPSClient;
-
-/**
-*
-* @author <a href="http://mina.apache.org">Apache MINA Project</a>
-*
-*/
-public class MinaCipherSuitesTest extends SSLTestTemplate {
-
-    @Override
-    protected String getAuthValue() {
-        return "TLS";
-    }
-
-    @Override
-    protected boolean useImplicit() {
-        return true;
-    }
-
-    @Override
-    protected SslConfigurationFactory createSslConfiguration() {
-        SslConfigurationFactory sslConfigFactory = super.createSslConfiguration();
-
-        sslConfigFactory
-        .setEnabledCipherSuites(new String[] { "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" });
-
-        return sslConfigFactory;
-    }
-    
-    @Override
-    protected FTPSClient createFTPClient() throws Exception {
-        return new FTPSClient(true);
-    }
-
-    @Override
-    protected boolean isConnectClient() {
-        return false;
-    }
-
-    /*
-     * Only certain cipher suites will work with the keys and protocol we're
-     * using for this test. Two suites known to work is:
-     * SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
-     */
-    public void testEnabled() throws Exception {
-
-        ((FTPSClient) client)
-                .setEnabledCipherSuites(new String[] { "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" });
-
-        connectClient();
-    }
-
-    public void testDisabled() throws Exception {
-        ((FTPSClient) client)
-                .setEnabledCipherSuites(new String[] { "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA" });
-
-        try {
-            doConnect();
-            fail("Must throw SSLHandshakeException");
-        } catch (SSLHandshakeException e) {
-            // OK
-        }
-    }
-}
+/*
+ * 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.ftpserver.ssl;
+
+import javax.net.ssl.SSLHandshakeException;
+
+import org.apache.commons.net.ftp.FTPSClient;
+
+/**
+*
+* @author <a href="http://mina.apache.org">Apache MINA Project</a>
+*
+*/
+public class MinaCipherSuitesTest extends SSLTestTemplate {
+
+    @Override
+    protected String getAuthValue() {
+        return "TLS";
+    }
+
+    @Override
+    protected boolean useImplicit() {
+        return true;
+    }
+
+    @Override
+    protected SslConfigurationFactory createSslConfiguration() {
+        SslConfigurationFactory sslConfigFactory = super.createSslConfiguration();
+
+        sslConfigFactory
+        .setEnabledCipherSuites(new String[] { "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" });
+
+        return sslConfigFactory;
+    }
+    
+    @Override
+    protected FTPSClient createFTPClient() throws Exception {
+        return new FTPSClient(true);
+    }
+
+    @Override
+    protected boolean isConnectClient() {
+        return false;
+    }
+
+    /*
+     * Only certain cipher suites will work with the keys and protocol we're
+     * using for this test. Two suites known to work is:
+     * SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
+     */
+    public void testEnabled() throws Exception {
+
+        ((FTPSClient) client)
+                .setEnabledCipherSuites(new String[] { "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA" });
+
+        connectClient();
+    }
+
+    public void testDisabled() throws Exception {
+        ((FTPSClient) client)
+                .setEnabledCipherSuites(new String[] { "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA" });
+
+        try {
+            doConnect();
+            fail("Must throw SSLHandshakeException");
+        } catch (SSLHandshakeException e) {
+            // OK
+        }
+    }
+}


[17/50] [abbrv] git commit: Fix eol-style properties

Posted by ng...@apache.org.
Fix eol-style properties

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129819 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/e95456b5
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/e95456b5
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/e95456b5

Branch: refs/heads/trunk
Commit: e95456b571fb6354173ac9b0e06629359748944b
Parents: de4899f
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 17:40:03 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 17:40:03 2011 +0000

----------------------------------------------------------------------
 distribution/bin/service.bat | 304 +++++++++++++++++++-------------------
 1 file changed, 152 insertions(+), 152 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/e95456b5/distribution/bin/service.bat
----------------------------------------------------------------------
diff --git a/distribution/bin/service.bat b/distribution/bin/service.bat
index a781e97..82113e3 100644
--- a/distribution/bin/service.bat
+++ b/distribution/bin/service.bat
@@ -1,152 +1,152 @@
-@echo off
-
-REM Licensed to the Apache Software Foundation (ASF) under one
-REM or more contributor license agreements.  See the NOTICE file
-REM distributed with this work for additional information
-REM regarding copyright ownership.  The ASF licenses this file
-REM to you under the Apache License, Version 2.0 (the
-REM "License"); you may not use this file except in compliance
-REM with the License.  You may obtain a copy of the License at
-REM
-REM  http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing,
-REM software distributed under the License is distributed on an
-REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-REM KIND, either express or implied.  See the License for the
-REM specific language governing permissions and limitations
-REM under the License.
-
-
-if "%OS%" == "Windows_NT" setlocal
-rem ---------------------------------------------------------------------------
-rem NT Service Install/Uninstall script
-rem
-rem Options
-rem install                Install the service using ftpd as service name.
-rem                        Service is installed using default settings.
-rem remove                 Remove the service from the System.
-rem
-rem name        (optional) If the second argument is present it is considered
-rem                        to be new service name                                           
-rem
-rem $Id: service.bat 467182 2006-10-23 23:47:06Z markt $
-rem ---------------------------------------------------------------------------
-
-rem Guess CATALINA_HOME if not defined
-set CURRENT_DIR=%cd%
-if not "%FTPD_HOME%" == "" goto gotHome
-set FTPD_HOME=%cd%
-if exist "%FTPD_HOME%\bin\ftpd.exe" goto okHome
-rem CD to the upper dir
-cd ..
-set FTPD_HOME=%cd%
-:gotHome
-if exist "%FTPD_HOME%\bin\ftpd.exe" goto okHome
-echo The ftpd.exe was not found...
-echo The FTPD_HOME environment variable is not defined correctly.
-echo This environment variable is needed to run this program
-goto end
-rem Make sure prerequisite environment variables are set
-if not "%JAVA_HOME%" == "" goto okHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto end 
-:okHome
-
-set EXECUTABLE=%FTPD_HOME%\bin\ftpd.exe
-
-rem Set default Service name
-set SERVICE_NAME=ftpd
-set PR_DISPLAYNAME=Apache FtpServer
-
-if "%1" == "" goto displayUsage
-if "%2" == "" goto setServiceName
-set SERVICE_NAME=%2
-set PR_DISPLAYNAME=Apache FtpServer %2
-:setServiceName
-if %1 == install goto doInstall
-if %1 == remove goto doRemove
-if %1 == uninstall goto doRemove
-echo Unknown parameter "%1"
-:displayUsage
-echo.
-echo Usage: service.bat install/remove [service_name]
-goto end
-
-:doRemove
-rem Remove the service
-"%EXECUTABLE%" //DS//%SERVICE_NAME%
-echo The service '%SERVICE_NAME%' has been removed
-goto end
-
-:doInstall
-rem Install the service
-echo Installing the service '%SERVICE_NAME%' ...
-echo Using FTPD_HOME:        %FTPD_HOME%
-echo Using JAVA_HOME:        %JAVA_HOME%
-
-rem ----- Create CLASSPATH --------------------------------------------
-set FTPD_CLASSPATH=%FTPD_HOME%\common\classes
-cd /d "%FTPD_HOME%\common\lib"
-for %%i in ("*.jar") do call "%FTPD_HOME%\bin\appendcp.bat" "%FTPD_HOME%\common\lib\%%i"
-cd /d %FTPD_HOME%
-
-rem Use the environment variables as an example
-rem Each command line option is prefixed with PR_
-
-set FTPD_LOGPATH=%FTPD_HOME%\res\log
-
-set PR_DESCRIPTION=Apache FtpServer (http://mina.apache.org/ftpserver/)
-set PR_INSTALL=%EXECUTABLE%
-set PR_LOGPATH=%FTPD_LOGPATH%
-set PR_CLASSPATH=%FTPD_CLASSPATH%
-rem Set the server jvm from JAVA_HOME
-set PR_JVM=%JAVA_HOME%\jre\bin\server\jvm.dll
-if exist "%PR_JVM%" goto foundJvm
-rem Set the client jvm from JAVA_HOME
-set PR_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll
-if exist "%PR_JVM%" goto foundJvm
-set PR_JVM=auto
-:foundJvm
-echo Using JVM:              %PR_JVM%
-
-rem Supply additional command line params as start params
-
-set CMD_LINE_ARGS=start
-echo %CMD_LINE_ARGS%
-shift
-shift
-:buildArgs
-if %1a==a goto endInit
-set CMD_LINE_ARGS=%CMD_LINE_ARGS%;%1
-echo %CMD_LINE_ARGS%
-shift
-goto buildArgs
-
-:endInit
-echo %CMD_LINE_ARGS%
-
-"%EXECUTABLE%" //IS//%SERVICE_NAME% --StartClass org.apache.ftpserver.main.Daemon --StartParams %CMD_LINE_ARGS% --StartPath "%FTPD_HOME%" --StopClass org.apache.ftpserver.main.Daemon --StopParams stop 
-if not errorlevel 1 goto installed
-echo Failed installing '%SERVICE_NAME%' service
-goto end
-:installed
-rem Clear the environment variables. They are not needed any more.
-set PR_DISPLAYNAME=
-set PR_DESCRIPTION=
-set PR_INSTALL=
-set PR_LOGPATH=
-set PR_CLASSPATH=
-set PR_JVM=
-rem Set extra parameters
-"%EXECUTABLE%" //US//%SERVICE_NAME% --StartMode jvm --StopMode jvm --StdOutput "%FTPD_LOGPATH%\out.log" --StdError "%FTPD_LOGPATH%\error.log"
-rem More extra parameters
-set PR_LOGPATH=%FTPD_HOME%\logs
-set PR_STDOUTPUT=auto
-set PR_STDERROR=auto
-REM "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMs 128 --JvmMx 256
-echo The service '%SERVICE_NAME%' has been installed.
-
-:end
-cd %CURRENT_DIR%
+@echo off
+
+REM Licensed to the Apache Software Foundation (ASF) under one
+REM or more contributor license agreements.  See the NOTICE file
+REM distributed with this work for additional information
+REM regarding copyright ownership.  The ASF licenses this file
+REM to you under the Apache License, Version 2.0 (the
+REM "License"); you may not use this file except in compliance
+REM with the License.  You may obtain a copy of the License at
+REM
+REM  http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing,
+REM software distributed under the License is distributed on an
+REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+REM KIND, either express or implied.  See the License for the
+REM specific language governing permissions and limitations
+REM under the License.
+
+
+if "%OS%" == "Windows_NT" setlocal
+rem ---------------------------------------------------------------------------
+rem NT Service Install/Uninstall script
+rem
+rem Options
+rem install                Install the service using ftpd as service name.
+rem                        Service is installed using default settings.
+rem remove                 Remove the service from the System.
+rem
+rem name        (optional) If the second argument is present it is considered
+rem                        to be new service name                                           
+rem
+rem $Id: service.bat 467182 2006-10-23 23:47:06Z markt $
+rem ---------------------------------------------------------------------------
+
+rem Guess CATALINA_HOME if not defined
+set CURRENT_DIR=%cd%
+if not "%FTPD_HOME%" == "" goto gotHome
+set FTPD_HOME=%cd%
+if exist "%FTPD_HOME%\bin\ftpd.exe" goto okHome
+rem CD to the upper dir
+cd ..
+set FTPD_HOME=%cd%
+:gotHome
+if exist "%FTPD_HOME%\bin\ftpd.exe" goto okHome
+echo The ftpd.exe was not found...
+echo The FTPD_HOME environment variable is not defined correctly.
+echo This environment variable is needed to run this program
+goto end
+rem Make sure prerequisite environment variables are set
+if not "%JAVA_HOME%" == "" goto okHome
+echo The JAVA_HOME environment variable is not defined
+echo This environment variable is needed to run this program
+goto end 
+:okHome
+
+set EXECUTABLE=%FTPD_HOME%\bin\ftpd.exe
+
+rem Set default Service name
+set SERVICE_NAME=ftpd
+set PR_DISPLAYNAME=Apache FtpServer
+
+if "%1" == "" goto displayUsage
+if "%2" == "" goto setServiceName
+set SERVICE_NAME=%2
+set PR_DISPLAYNAME=Apache FtpServer %2
+:setServiceName
+if %1 == install goto doInstall
+if %1 == remove goto doRemove
+if %1 == uninstall goto doRemove
+echo Unknown parameter "%1"
+:displayUsage
+echo.
+echo Usage: service.bat install/remove [service_name]
+goto end
+
+:doRemove
+rem Remove the service
+"%EXECUTABLE%" //DS//%SERVICE_NAME%
+echo The service '%SERVICE_NAME%' has been removed
+goto end
+
+:doInstall
+rem Install the service
+echo Installing the service '%SERVICE_NAME%' ...
+echo Using FTPD_HOME:        %FTPD_HOME%
+echo Using JAVA_HOME:        %JAVA_HOME%
+
+rem ----- Create CLASSPATH --------------------------------------------
+set FTPD_CLASSPATH=%FTPD_HOME%\common\classes
+cd /d "%FTPD_HOME%\common\lib"
+for %%i in ("*.jar") do call "%FTPD_HOME%\bin\appendcp.bat" "%FTPD_HOME%\common\lib\%%i"
+cd /d %FTPD_HOME%
+
+rem Use the environment variables as an example
+rem Each command line option is prefixed with PR_
+
+set FTPD_LOGPATH=%FTPD_HOME%\res\log
+
+set PR_DESCRIPTION=Apache FtpServer (http://mina.apache.org/ftpserver/)
+set PR_INSTALL=%EXECUTABLE%
+set PR_LOGPATH=%FTPD_LOGPATH%
+set PR_CLASSPATH=%FTPD_CLASSPATH%
+rem Set the server jvm from JAVA_HOME
+set PR_JVM=%JAVA_HOME%\jre\bin\server\jvm.dll
+if exist "%PR_JVM%" goto foundJvm
+rem Set the client jvm from JAVA_HOME
+set PR_JVM=%JAVA_HOME%\jre\bin\client\jvm.dll
+if exist "%PR_JVM%" goto foundJvm
+set PR_JVM=auto
+:foundJvm
+echo Using JVM:              %PR_JVM%
+
+rem Supply additional command line params as start params
+
+set CMD_LINE_ARGS=start
+echo %CMD_LINE_ARGS%
+shift
+shift
+:buildArgs
+if %1a==a goto endInit
+set CMD_LINE_ARGS=%CMD_LINE_ARGS%;%1
+echo %CMD_LINE_ARGS%
+shift
+goto buildArgs
+
+:endInit
+echo %CMD_LINE_ARGS%
+
+"%EXECUTABLE%" //IS//%SERVICE_NAME% --StartClass org.apache.ftpserver.main.Daemon --StartParams %CMD_LINE_ARGS% --StartPath "%FTPD_HOME%" --StopClass org.apache.ftpserver.main.Daemon --StopParams stop 
+if not errorlevel 1 goto installed
+echo Failed installing '%SERVICE_NAME%' service
+goto end
+:installed
+rem Clear the environment variables. They are not needed any more.
+set PR_DISPLAYNAME=
+set PR_DESCRIPTION=
+set PR_INSTALL=
+set PR_LOGPATH=
+set PR_CLASSPATH=
+set PR_JVM=
+rem Set extra parameters
+"%EXECUTABLE%" //US//%SERVICE_NAME% --StartMode jvm --StopMode jvm --StdOutput "%FTPD_LOGPATH%\out.log" --StdError "%FTPD_LOGPATH%\error.log"
+rem More extra parameters
+set PR_LOGPATH=%FTPD_HOME%\logs
+set PR_STDOUTPUT=auto
+set PR_STDERROR=auto
+REM "%EXECUTABLE%" //US//%SERVICE_NAME% ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp" --JvmMs 128 --JvmMx 256
+echo The service '%SERVICE_NAME%' has been installed.
+
+:end
+cd %CURRENT_DIR%


[24/50] [abbrv] git commit: Fix eol-style

Posted by ng...@apache.org.
Fix eol-style

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129827 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/9769d29a
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/9769d29a
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/9769d29a

Branch: refs/heads/trunk
Commit: 9769d29a75eb50a8368e8b0cdbe2f29fa852409e
Parents: bda3f6b
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 17:52:32 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 17:52:32 2011 +0000

----------------------------------------------------------------------
 .../spring/ListenerBeanDefinitionParser.java    | 600 +++++++++----------
 .../impl/LocalizedDataTransferFtpReply.java     | 268 ++++-----
 .../impl/LocalizedFileActionFtpReply.java       | 176 +++---
 .../ftpserver/impl/LocalizedRenameFtpReply.java | 206 +++----
 .../ftpserver/ipfilter/MinaSessionFilter.java   | 116 ++--
 .../ftpserver/ipfilter/RemoteIpFilter.java      | 446 +++++++-------
 .../clienttests/ActiveModeReplyTest.java        | 158 ++---
 .../PasvAddressWithOverridenHostnameGetter.java | 146 ++---
 .../impl/listing/DirectoryListerTest.java       | 206 +++----
 .../ftpserver/ssl/MinaCipherSuitesTest.java     | 174 +++---
 10 files changed, 1248 insertions(+), 1248 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java b/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
index c367669..68cf398 100644
--- a/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
+++ b/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
@@ -1,300 +1,300 @@
-/*
- * 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.ftpserver.config.spring;
-
-import java.net.UnknownHostException;
-
-import org.apache.ftpserver.DataConnectionConfiguration;
-import org.apache.ftpserver.DataConnectionConfigurationFactory;
-import org.apache.ftpserver.FtpServerConfigurationException;
-import org.apache.ftpserver.ipfilter.IpFilterType;
-import org.apache.ftpserver.ipfilter.RemoteIpFilter;
-import org.apache.ftpserver.listener.ListenerFactory;
-import org.apache.ftpserver.ssl.SslConfiguration;
-import org.apache.ftpserver.ssl.SslConfigurationFactory;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.config.BeanDefinitionHolder;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.util.StringUtils;
-import org.w3c.dom.Element;
-
-/**
- * Parses the FtpServer "nio-listener" element into a Spring bean graph
- *
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- */
-public class ListenerBeanDefinitionParser extends
-        AbstractSingleBeanDefinitionParser {
-
-    private final Logger LOG = LoggerFactory
-            .getLogger(ListenerBeanDefinitionParser.class);
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected Class<?> getBeanClass(final Element element) {
-        return null;
-    }
-
-    /**
-     * {@inheritDoc}
-     */
-    @Override
-    protected void doParse(final Element element,
-            final ParserContext parserContext,
-            final BeanDefinitionBuilder builder) {
-
-        BeanDefinitionBuilder factoryBuilder = BeanDefinitionBuilder.genericBeanDefinition(ListenerFactory.class);
-
-        if (StringUtils.hasText(element.getAttribute("port"))) {
-            factoryBuilder.addPropertyValue("port", Integer.valueOf(element
-                    .getAttribute("port")));
-        }
-
-        SslConfiguration ssl = parseSsl(element);
-        if (ssl != null) {
-            factoryBuilder.addPropertyValue("sslConfiguration", ssl);
-        }
-
-        Element dataConElm = SpringUtil.getChildElement(element,
-                FtpServerNamespaceHandler.FTPSERVER_NS, "data-connection");
-        DataConnectionConfiguration dc = parseDataConnection(dataConElm, ssl);
-        factoryBuilder.addPropertyValue("dataConnectionConfiguration", dc);
-
-        if (StringUtils.hasText(element.getAttribute("idle-timeout"))) {
-            factoryBuilder.addPropertyValue("idleTimeout", SpringUtil.parseInt(
-                    element, "idle-timeout", 300));
-        }
-
-        String localAddress = SpringUtil.parseStringFromInetAddress(element,
-                "local-address");
-        if (localAddress != null) {
-            factoryBuilder.addPropertyValue("serverAddress", localAddress);
-        }
-        factoryBuilder.addPropertyValue("implicitSsl", SpringUtil.parseBoolean(
-                element, "implicit-ssl", false));
-
-        Element blacklistElm = SpringUtil.getChildElement(element,
-                FtpServerNamespaceHandler.FTPSERVER_NS, "blacklist");
-        if (blacklistElm != null) {
-            LOG
-                    .warn("Element 'blacklist' is deprecated, and may be removed in a future release. Please use 'remote-ip-filter' instead. ");
-            try {
-                RemoteIpFilter remoteIpFilter = new RemoteIpFilter(IpFilterType.DENY,
-                        blacklistElm.getTextContent());
-                factoryBuilder.addPropertyValue("sessionFilter", remoteIpFilter);
-            } catch (UnknownHostException e) {
-                throw new IllegalArgumentException(
-                        "Invalid IP address or subnet in the 'blacklist' element",
-                        e);
-            }
-        }
-
-        Element remoteIpFilterElement = SpringUtil.getChildElement(element,
-                FtpServerNamespaceHandler.FTPSERVER_NS, "remote-ip-filter");
-        if (remoteIpFilterElement != null) {
-            if (blacklistElm != null) {
-                throw new FtpServerConfigurationException(
-                        "Element 'remote-ip-filter' may not be used when 'blacklist' element is specified. ");
-            }
-            String filterType = remoteIpFilterElement.getAttribute("type");
-            try {
-                RemoteIpFilter remoteIpFilter = new RemoteIpFilter(IpFilterType
-                        .parse(filterType), remoteIpFilterElement
-                        .getTextContent());
-                factoryBuilder
-                        .addPropertyValue("sessionFilter", remoteIpFilter);
-            } catch (UnknownHostException e) {
-                throw new IllegalArgumentException(
-                        "Invalid IP address or subnet in the 'remote-ip-filter' element");
-            }
-        }
-        
-        BeanDefinition factoryDefinition = factoryBuilder.getBeanDefinition();
-
-        String listenerFactoryName = parserContext.getReaderContext().generateBeanName(factoryDefinition);
-        
-        BeanDefinitionHolder factoryHolder = new BeanDefinitionHolder(factoryDefinition, listenerFactoryName);
-        registerBeanDefinition(factoryHolder, parserContext.getRegistry());
-
-        // set the factory on the listener bean
-        builder.getRawBeanDefinition().setFactoryBeanName(listenerFactoryName);
-        builder.getRawBeanDefinition().setFactoryMethodName("createListener");
-    }
-
-    private SslConfiguration parseSsl(final Element parent) {
-        Element sslElm = SpringUtil.getChildElement(parent,
-                FtpServerNamespaceHandler.FTPSERVER_NS, "ssl");
-
-        if (sslElm != null) {
-            SslConfigurationFactory ssl = new SslConfigurationFactory();
-
-            Element keyStoreElm = SpringUtil.getChildElement(sslElm,
-                    FtpServerNamespaceHandler.FTPSERVER_NS, "keystore");
-            if (keyStoreElm != null) {
-                ssl.setKeystoreFile(SpringUtil.parseFile(keyStoreElm, "file"));
-                ssl.setKeystorePassword(SpringUtil.parseString(keyStoreElm,
-                        "password"));
-
-                String type = SpringUtil.parseString(keyStoreElm, "type");
-                if (type != null) {
-                    ssl.setKeystoreType(type);
-                }
-
-                String keyAlias = SpringUtil.parseString(keyStoreElm,
-                        "key-alias");
-                if (keyAlias != null) {
-                    ssl.setKeyAlias(keyAlias);
-                }
-
-                String keyPassword = SpringUtil.parseString(keyStoreElm,
-                        "key-password");
-                if (keyPassword != null) {
-                    ssl.setKeyPassword(keyPassword);
-                }
-
-                String algorithm = SpringUtil.parseString(keyStoreElm,
-                        "algorithm");
-                if (algorithm != null) {
-                    ssl.setKeystoreAlgorithm(algorithm);
-                }
-            }
-
-            Element trustStoreElm = SpringUtil.getChildElement(sslElm,
-                    FtpServerNamespaceHandler.FTPSERVER_NS, "truststore");
-            if (trustStoreElm != null) {
-                ssl.setTruststoreFile(SpringUtil.parseFile(trustStoreElm,
-                        "file"));
-                ssl.setTruststorePassword(SpringUtil.parseString(trustStoreElm,
-                        "password"));
-
-                String type = SpringUtil.parseString(trustStoreElm, "type");
-                if (type != null) {
-                    ssl.setTruststoreType(type);
-                }
-
-                String algorithm = SpringUtil.parseString(trustStoreElm,
-                        "algorithm");
-                if (algorithm != null) {
-                    ssl.setTruststoreAlgorithm(algorithm);
-                }
-            }
-
-            String clientAuthStr = SpringUtil.parseString(sslElm,
-                    "client-authentication");
-            if (clientAuthStr != null) {
-                ssl.setClientAuthentication(clientAuthStr);
-            }
-
-            String enabledCiphersuites = SpringUtil.parseString(sslElm,
-                    "enabled-ciphersuites");
-            if (enabledCiphersuites != null) {
-                ssl.setEnabledCipherSuites(enabledCiphersuites.split(" "));
-            }
-
-            String protocol = SpringUtil.parseString(sslElm, "protocol");
-            if (protocol != null) {
-                ssl.setSslProtocol(protocol);
-            }
-
-            return ssl.createSslConfiguration();
-        } else {
-            return null;
-        }
-
-    }
-
-    private DataConnectionConfiguration parseDataConnection(
-            final Element element,
-            final SslConfiguration listenerSslConfiguration) {
-        DataConnectionConfigurationFactory dc = new DataConnectionConfigurationFactory();
-
-        if (element != null) {
-            
-            dc.setImplicitSsl(SpringUtil.parseBoolean(element, "implicit-ssl", false));
-            
-            // data con config element available
-            SslConfiguration ssl = parseSsl(element);
-
-            if (ssl != null) {
-                LOG.debug("SSL configuration found for the data connection");
-                dc.setSslConfiguration(ssl);
-            }
-
-            dc.setIdleTime(SpringUtil.parseInt(element, "idle-timeout", dc.getIdleTime()));
-
-            Element activeElm = SpringUtil.getChildElement(element,
-                    FtpServerNamespaceHandler.FTPSERVER_NS, "active");
-            if (activeElm != null) {
-                dc.setActiveEnabled(SpringUtil.parseBoolean(activeElm, "enabled",
-                        true));
-                dc.setActiveIpCheck(SpringUtil.parseBoolean(activeElm,
-                        "ip-check", false));
-                dc.setActiveLocalPort(SpringUtil.parseInt(activeElm,
-                        "local-port", 0));
-                
-                String localAddress = SpringUtil.parseStringFromInetAddress(
-                        activeElm, "local-address");
-                if (localAddress != null) {
-                	dc.setActiveLocalAddress(localAddress);
-                }
-            }
-
-            Element passiveElm = SpringUtil.getChildElement(element,
-                    FtpServerNamespaceHandler.FTPSERVER_NS, "passive");
-            if (passiveElm != null) {
-                String address = SpringUtil.parseStringFromInetAddress(passiveElm,
-                        "address");
-                if (address != null) {
-                	dc.setPassiveAddress(address);
-                }
-
-                String externalAddress = SpringUtil.parseStringFromInetAddress(
-                        passiveElm, "external-address");
-                if (externalAddress != null) {
-                    dc.setPassiveExternalAddress(externalAddress);
-                }
-
-                String ports = SpringUtil.parseString(passiveElm, "ports");
-                if (ports != null) {
-                    dc.setPassivePorts(ports);
-                }
-                dc.setPassiveIpCheck(SpringUtil.parseBoolean(passiveElm,
-                    "ip-check", false));
-            }
-        } else {
-            // no data conn config element, do we still have SSL config from the
-            // parent?
-            if (listenerSslConfiguration != null) {
-                LOG
-                        .debug("SSL configuration found for the listener, falling back for that for the data connection");
-                dc.setSslConfiguration(listenerSslConfiguration);
-            }
-        }
-
-        return dc.createDataConnectionConfiguration();
-    }
-
-}
+/*
+ * 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.ftpserver.config.spring;
+
+import java.net.UnknownHostException;
+
+import org.apache.ftpserver.DataConnectionConfiguration;
+import org.apache.ftpserver.DataConnectionConfigurationFactory;
+import org.apache.ftpserver.FtpServerConfigurationException;
+import org.apache.ftpserver.ipfilter.IpFilterType;
+import org.apache.ftpserver.ipfilter.RemoteIpFilter;
+import org.apache.ftpserver.listener.ListenerFactory;
+import org.apache.ftpserver.ssl.SslConfiguration;
+import org.apache.ftpserver.ssl.SslConfigurationFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.BeanDefinitionHolder;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.util.StringUtils;
+import org.w3c.dom.Element;
+
+/**
+ * Parses the FtpServer "nio-listener" element into a Spring bean graph
+ *
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ */
+public class ListenerBeanDefinitionParser extends
+        AbstractSingleBeanDefinitionParser {
+
+    private final Logger LOG = LoggerFactory
+            .getLogger(ListenerBeanDefinitionParser.class);
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected Class<?> getBeanClass(final Element element) {
+        return null;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void doParse(final Element element,
+            final ParserContext parserContext,
+            final BeanDefinitionBuilder builder) {
+
+        BeanDefinitionBuilder factoryBuilder = BeanDefinitionBuilder.genericBeanDefinition(ListenerFactory.class);
+
+        if (StringUtils.hasText(element.getAttribute("port"))) {
+            factoryBuilder.addPropertyValue("port", Integer.valueOf(element
+                    .getAttribute("port")));
+        }
+
+        SslConfiguration ssl = parseSsl(element);
+        if (ssl != null) {
+            factoryBuilder.addPropertyValue("sslConfiguration", ssl);
+        }
+
+        Element dataConElm = SpringUtil.getChildElement(element,
+                FtpServerNamespaceHandler.FTPSERVER_NS, "data-connection");
+        DataConnectionConfiguration dc = parseDataConnection(dataConElm, ssl);
+        factoryBuilder.addPropertyValue("dataConnectionConfiguration", dc);
+
+        if (StringUtils.hasText(element.getAttribute("idle-timeout"))) {
+            factoryBuilder.addPropertyValue("idleTimeout", SpringUtil.parseInt(
+                    element, "idle-timeout", 300));
+        }
+
+        String localAddress = SpringUtil.parseStringFromInetAddress(element,
+                "local-address");
+        if (localAddress != null) {
+            factoryBuilder.addPropertyValue("serverAddress", localAddress);
+        }
+        factoryBuilder.addPropertyValue("implicitSsl", SpringUtil.parseBoolean(
+                element, "implicit-ssl", false));
+
+        Element blacklistElm = SpringUtil.getChildElement(element,
+                FtpServerNamespaceHandler.FTPSERVER_NS, "blacklist");
+        if (blacklistElm != null) {
+            LOG
+                    .warn("Element 'blacklist' is deprecated, and may be removed in a future release. Please use 'remote-ip-filter' instead. ");
+            try {
+                RemoteIpFilter remoteIpFilter = new RemoteIpFilter(IpFilterType.DENY,
+                        blacklistElm.getTextContent());
+                factoryBuilder.addPropertyValue("sessionFilter", remoteIpFilter);
+            } catch (UnknownHostException e) {
+                throw new IllegalArgumentException(
+                        "Invalid IP address or subnet in the 'blacklist' element",
+                        e);
+            }
+        }
+
+        Element remoteIpFilterElement = SpringUtil.getChildElement(element,
+                FtpServerNamespaceHandler.FTPSERVER_NS, "remote-ip-filter");
+        if (remoteIpFilterElement != null) {
+            if (blacklistElm != null) {
+                throw new FtpServerConfigurationException(
+                        "Element 'remote-ip-filter' may not be used when 'blacklist' element is specified. ");
+            }
+            String filterType = remoteIpFilterElement.getAttribute("type");
+            try {
+                RemoteIpFilter remoteIpFilter = new RemoteIpFilter(IpFilterType
+                        .parse(filterType), remoteIpFilterElement
+                        .getTextContent());
+                factoryBuilder
+                        .addPropertyValue("sessionFilter", remoteIpFilter);
+            } catch (UnknownHostException e) {
+                throw new IllegalArgumentException(
+                        "Invalid IP address or subnet in the 'remote-ip-filter' element");
+            }
+        }
+        
+        BeanDefinition factoryDefinition = factoryBuilder.getBeanDefinition();
+
+        String listenerFactoryName = parserContext.getReaderContext().generateBeanName(factoryDefinition);
+        
+        BeanDefinitionHolder factoryHolder = new BeanDefinitionHolder(factoryDefinition, listenerFactoryName);
+        registerBeanDefinition(factoryHolder, parserContext.getRegistry());
+
+        // set the factory on the listener bean
+        builder.getRawBeanDefinition().setFactoryBeanName(listenerFactoryName);
+        builder.getRawBeanDefinition().setFactoryMethodName("createListener");
+    }
+
+    private SslConfiguration parseSsl(final Element parent) {
+        Element sslElm = SpringUtil.getChildElement(parent,
+                FtpServerNamespaceHandler.FTPSERVER_NS, "ssl");
+
+        if (sslElm != null) {
+            SslConfigurationFactory ssl = new SslConfigurationFactory();
+
+            Element keyStoreElm = SpringUtil.getChildElement(sslElm,
+                    FtpServerNamespaceHandler.FTPSERVER_NS, "keystore");
+            if (keyStoreElm != null) {
+                ssl.setKeystoreFile(SpringUtil.parseFile(keyStoreElm, "file"));
+                ssl.setKeystorePassword(SpringUtil.parseString(keyStoreElm,
+                        "password"));
+
+                String type = SpringUtil.parseString(keyStoreElm, "type");
+                if (type != null) {
+                    ssl.setKeystoreType(type);
+                }
+
+                String keyAlias = SpringUtil.parseString(keyStoreElm,
+                        "key-alias");
+                if (keyAlias != null) {
+                    ssl.setKeyAlias(keyAlias);
+                }
+
+                String keyPassword = SpringUtil.parseString(keyStoreElm,
+                        "key-password");
+                if (keyPassword != null) {
+                    ssl.setKeyPassword(keyPassword);
+                }
+
+                String algorithm = SpringUtil.parseString(keyStoreElm,
+                        "algorithm");
+                if (algorithm != null) {
+                    ssl.setKeystoreAlgorithm(algorithm);
+                }
+            }
+
+            Element trustStoreElm = SpringUtil.getChildElement(sslElm,
+                    FtpServerNamespaceHandler.FTPSERVER_NS, "truststore");
+            if (trustStoreElm != null) {
+                ssl.setTruststoreFile(SpringUtil.parseFile(trustStoreElm,
+                        "file"));
+                ssl.setTruststorePassword(SpringUtil.parseString(trustStoreElm,
+                        "password"));
+
+                String type = SpringUtil.parseString(trustStoreElm, "type");
+                if (type != null) {
+                    ssl.setTruststoreType(type);
+                }
+
+                String algorithm = SpringUtil.parseString(trustStoreElm,
+                        "algorithm");
+                if (algorithm != null) {
+                    ssl.setTruststoreAlgorithm(algorithm);
+                }
+            }
+
+            String clientAuthStr = SpringUtil.parseString(sslElm,
+                    "client-authentication");
+            if (clientAuthStr != null) {
+                ssl.setClientAuthentication(clientAuthStr);
+            }
+
+            String enabledCiphersuites = SpringUtil.parseString(sslElm,
+                    "enabled-ciphersuites");
+            if (enabledCiphersuites != null) {
+                ssl.setEnabledCipherSuites(enabledCiphersuites.split(" "));
+            }
+
+            String protocol = SpringUtil.parseString(sslElm, "protocol");
+            if (protocol != null) {
+                ssl.setSslProtocol(protocol);
+            }
+
+            return ssl.createSslConfiguration();
+        } else {
+            return null;
+        }
+
+    }
+
+    private DataConnectionConfiguration parseDataConnection(
+            final Element element,
+            final SslConfiguration listenerSslConfiguration) {
+        DataConnectionConfigurationFactory dc = new DataConnectionConfigurationFactory();
+
+        if (element != null) {
+            
+            dc.setImplicitSsl(SpringUtil.parseBoolean(element, "implicit-ssl", false));
+            
+            // data con config element available
+            SslConfiguration ssl = parseSsl(element);
+
+            if (ssl != null) {
+                LOG.debug("SSL configuration found for the data connection");
+                dc.setSslConfiguration(ssl);
+            }
+
+            dc.setIdleTime(SpringUtil.parseInt(element, "idle-timeout", dc.getIdleTime()));
+
+            Element activeElm = SpringUtil.getChildElement(element,
+                    FtpServerNamespaceHandler.FTPSERVER_NS, "active");
+            if (activeElm != null) {
+                dc.setActiveEnabled(SpringUtil.parseBoolean(activeElm, "enabled",
+                        true));
+                dc.setActiveIpCheck(SpringUtil.parseBoolean(activeElm,
+                        "ip-check", false));
+                dc.setActiveLocalPort(SpringUtil.parseInt(activeElm,
+                        "local-port", 0));
+                
+                String localAddress = SpringUtil.parseStringFromInetAddress(
+                        activeElm, "local-address");
+                if (localAddress != null) {
+                	dc.setActiveLocalAddress(localAddress);
+                }
+            }
+
+            Element passiveElm = SpringUtil.getChildElement(element,
+                    FtpServerNamespaceHandler.FTPSERVER_NS, "passive");
+            if (passiveElm != null) {
+                String address = SpringUtil.parseStringFromInetAddress(passiveElm,
+                        "address");
+                if (address != null) {
+                	dc.setPassiveAddress(address);
+                }
+
+                String externalAddress = SpringUtil.parseStringFromInetAddress(
+                        passiveElm, "external-address");
+                if (externalAddress != null) {
+                    dc.setPassiveExternalAddress(externalAddress);
+                }
+
+                String ports = SpringUtil.parseString(passiveElm, "ports");
+                if (ports != null) {
+                    dc.setPassivePorts(ports);
+                }
+                dc.setPassiveIpCheck(SpringUtil.parseBoolean(passiveElm,
+                    "ip-check", false));
+            }
+        } else {
+            // no data conn config element, do we still have SSL config from the
+            // parent?
+            if (listenerSslConfiguration != null) {
+                LOG
+                        .debug("SSL configuration found for the listener, falling back for that for the data connection");
+                dc.setSslConfiguration(listenerSslConfiguration);
+            }
+        }
+
+        return dc.createDataConnectionConfiguration();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/main/java/org/apache/ftpserver/impl/LocalizedDataTransferFtpReply.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/LocalizedDataTransferFtpReply.java b/core/src/main/java/org/apache/ftpserver/impl/LocalizedDataTransferFtpReply.java
index efdcacd..12f367e 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/LocalizedDataTransferFtpReply.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/LocalizedDataTransferFtpReply.java
@@ -1,134 +1,134 @@
-/*
- * 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.ftpserver.impl;
-
-import org.apache.ftpserver.ftplet.DataTransferFtpReply;
-import org.apache.ftpserver.ftplet.FtpFile;
-import org.apache.ftpserver.ftplet.FtpRequest;
-
-/**
- * An implementation of <code>DataTransferReply</code>.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public class LocalizedDataTransferFtpReply extends LocalizedFtpReply implements
-	DataTransferFtpReply {
-
-	/**
-	 * The file or directory that data transfer is related to.
-	 */
-	private final FtpFile file;
-
-	/**
-	 * total number of bytes transferred (bytes sent to the client or receivved
-	 * from the client)
-	 */
-	private final long bytesTransferred;
-
-	/**
-	 * Creates a new instance of <code>LocalizedFileTransferReply</code>.
-	 * 
-	 * @param code
-	 *            the reply code
-	 * @param message
-	 *            the detailed message
-	 * @param file
-	 *            the file or directory the data transfer is related to
-	 * @param bytesTransferred
-	 *            the number of bytes transferred
-	 */
-	public LocalizedDataTransferFtpReply(int code, String message,
-		FtpFile file, long bytesTransferred) {
-		super(code, message);
-		this.file = file;
-		this.bytesTransferred = bytesTransferred;
-	}
-
-	public FtpFile getFile() {
-		return file;
-	}
-
-	public long getBytesTransferred() {
-		return bytesTransferred;
-	}
-
-	/**
-	 * Returns the localized reply that contains all details about the data
-	 * transfer.
-	 * 
-	 * @param session
-	 *            the FTP session
-	 * @param request
-	 *            the FTP request
-	 * @param context
-	 *            the FTP server context
-	 * @param code
-	 *            the reply code
-	 * @param subId
-	 *            the sub message ID
-	 * @param basicMsg
-	 *            the basic message
-	 * @param file
-	 *            the file or directory that was transferred
-	 * @return the localized reply
-	 */
-	public static LocalizedDataTransferFtpReply translate(FtpIoSession session,
-		FtpRequest request, FtpServerContext context, int code, String subId,
-		String basicMsg, FtpFile file) {
-		String msg = FtpReplyTranslator.translateMessage(session, request,
-			context, code, subId, basicMsg);
-
-		return new LocalizedDataTransferFtpReply(code, msg, file, 0);
-	}
-
-	/**
-	 * Returns the localized reply that contains all details about the data
-	 * transfer.
-	 * 
-	 * @param session
-	 *            the FTP session
-	 * @param request
-	 *            the FTP request
-	 * @param context
-	 *            the FTP server context
-	 * @param code
-	 *            the reply code
-	 * @param subId
-	 *            the sub message ID
-	 * @param basicMsg
-	 *            the basic message
-	 * @param file
-	 *            the file or directory that was transferred
-	 * @param bytesTransferred
-	 *            total number of bytes transferred
-	 * @return the localized reply
-	 */
-	public static LocalizedDataTransferFtpReply translate(FtpIoSession session,
-		FtpRequest request, FtpServerContext context, int code, String subId,
-		String basicMsg, FtpFile file, long bytesTransferred) {
-		String msg = FtpReplyTranslator.translateMessage(session, request,
-			context, code, subId, basicMsg);
-
-		return new LocalizedDataTransferFtpReply(code, msg, file,
-			bytesTransferred);
-	}
-}
+/*
+ * 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.ftpserver.impl;
+
+import org.apache.ftpserver.ftplet.DataTransferFtpReply;
+import org.apache.ftpserver.ftplet.FtpFile;
+import org.apache.ftpserver.ftplet.FtpRequest;
+
+/**
+ * An implementation of <code>DataTransferReply</code>.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public class LocalizedDataTransferFtpReply extends LocalizedFtpReply implements
+	DataTransferFtpReply {
+
+	/**
+	 * The file or directory that data transfer is related to.
+	 */
+	private final FtpFile file;
+
+	/**
+	 * total number of bytes transferred (bytes sent to the client or receivved
+	 * from the client)
+	 */
+	private final long bytesTransferred;
+
+	/**
+	 * Creates a new instance of <code>LocalizedFileTransferReply</code>.
+	 * 
+	 * @param code
+	 *            the reply code
+	 * @param message
+	 *            the detailed message
+	 * @param file
+	 *            the file or directory the data transfer is related to
+	 * @param bytesTransferred
+	 *            the number of bytes transferred
+	 */
+	public LocalizedDataTransferFtpReply(int code, String message,
+		FtpFile file, long bytesTransferred) {
+		super(code, message);
+		this.file = file;
+		this.bytesTransferred = bytesTransferred;
+	}
+
+	public FtpFile getFile() {
+		return file;
+	}
+
+	public long getBytesTransferred() {
+		return bytesTransferred;
+	}
+
+	/**
+	 * Returns the localized reply that contains all details about the data
+	 * transfer.
+	 * 
+	 * @param session
+	 *            the FTP session
+	 * @param request
+	 *            the FTP request
+	 * @param context
+	 *            the FTP server context
+	 * @param code
+	 *            the reply code
+	 * @param subId
+	 *            the sub message ID
+	 * @param basicMsg
+	 *            the basic message
+	 * @param file
+	 *            the file or directory that was transferred
+	 * @return the localized reply
+	 */
+	public static LocalizedDataTransferFtpReply translate(FtpIoSession session,
+		FtpRequest request, FtpServerContext context, int code, String subId,
+		String basicMsg, FtpFile file) {
+		String msg = FtpReplyTranslator.translateMessage(session, request,
+			context, code, subId, basicMsg);
+
+		return new LocalizedDataTransferFtpReply(code, msg, file, 0);
+	}
+
+	/**
+	 * Returns the localized reply that contains all details about the data
+	 * transfer.
+	 * 
+	 * @param session
+	 *            the FTP session
+	 * @param request
+	 *            the FTP request
+	 * @param context
+	 *            the FTP server context
+	 * @param code
+	 *            the reply code
+	 * @param subId
+	 *            the sub message ID
+	 * @param basicMsg
+	 *            the basic message
+	 * @param file
+	 *            the file or directory that was transferred
+	 * @param bytesTransferred
+	 *            total number of bytes transferred
+	 * @return the localized reply
+	 */
+	public static LocalizedDataTransferFtpReply translate(FtpIoSession session,
+		FtpRequest request, FtpServerContext context, int code, String subId,
+		String basicMsg, FtpFile file, long bytesTransferred) {
+		String msg = FtpReplyTranslator.translateMessage(session, request,
+			context, code, subId, basicMsg);
+
+		return new LocalizedDataTransferFtpReply(code, msg, file,
+			bytesTransferred);
+	}
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/main/java/org/apache/ftpserver/impl/LocalizedFileActionFtpReply.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/LocalizedFileActionFtpReply.java b/core/src/main/java/org/apache/ftpserver/impl/LocalizedFileActionFtpReply.java
index 84a18a4..a867c70 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/LocalizedFileActionFtpReply.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/LocalizedFileActionFtpReply.java
@@ -1,88 +1,88 @@
-/*
- * 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.ftpserver.impl;
-
-import org.apache.ftpserver.ftplet.FileActionFtpReply;
-import org.apache.ftpserver.ftplet.FtpFile;
-import org.apache.ftpserver.ftplet.FtpRequest;
-
-/**
- * An implementation of <code>FileActionFtpReply</code>.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public class LocalizedFileActionFtpReply extends LocalizedFtpReply implements
-	FileActionFtpReply {
-
-	/**
-	 * The file or directory that data transfer is related to.
-	 */
-	private final FtpFile file;
-
-	/**
-	 * Creates a new instance of <code>LocalizedFileTransferReply</code>.
-	 * 
-	 * @param code
-	 *            the reply code
-	 * @param message
-	 *            the detailed message
-	 * @param file
-	 *            the file or directory the data transfer is related to
-	 */
-	public LocalizedFileActionFtpReply(int code, String message, FtpFile file) {
-		super(code, message);
-		this.file = file;
-	}
-
-	public FtpFile getFile() {
-		return file;
-	}
-
-	/**
-	 * Returns the localized reply that contains all details about the data
-	 * transfer.
-	 * 
-	 * @param session
-	 *            the FTP session
-	 * @param request
-	 *            the FTP request
-	 * @param context
-	 *            the FTP server context
-	 * @param code
-	 *            the reply code
-	 * @param subId
-	 *            the sub message ID
-	 * @param basicMsg
-	 *            the basic message
-	 * @param file
-	 *            the file or directory that was transferred
-	 * @return the localized reply
-	 */
-	public static LocalizedFileActionFtpReply translate(FtpIoSession session,
-		FtpRequest request, FtpServerContext context, int code, String subId,
-		String basicMsg, FtpFile file) {
-		String msg = FtpReplyTranslator.translateMessage(session, request,
-			context, code, subId, basicMsg);
-
-		return new LocalizedFileActionFtpReply(code, msg, file);
-	}
-}
+/*
+ * 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.ftpserver.impl;
+
+import org.apache.ftpserver.ftplet.FileActionFtpReply;
+import org.apache.ftpserver.ftplet.FtpFile;
+import org.apache.ftpserver.ftplet.FtpRequest;
+
+/**
+ * An implementation of <code>FileActionFtpReply</code>.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public class LocalizedFileActionFtpReply extends LocalizedFtpReply implements
+	FileActionFtpReply {
+
+	/**
+	 * The file or directory that data transfer is related to.
+	 */
+	private final FtpFile file;
+
+	/**
+	 * Creates a new instance of <code>LocalizedFileTransferReply</code>.
+	 * 
+	 * @param code
+	 *            the reply code
+	 * @param message
+	 *            the detailed message
+	 * @param file
+	 *            the file or directory the data transfer is related to
+	 */
+	public LocalizedFileActionFtpReply(int code, String message, FtpFile file) {
+		super(code, message);
+		this.file = file;
+	}
+
+	public FtpFile getFile() {
+		return file;
+	}
+
+	/**
+	 * Returns the localized reply that contains all details about the data
+	 * transfer.
+	 * 
+	 * @param session
+	 *            the FTP session
+	 * @param request
+	 *            the FTP request
+	 * @param context
+	 *            the FTP server context
+	 * @param code
+	 *            the reply code
+	 * @param subId
+	 *            the sub message ID
+	 * @param basicMsg
+	 *            the basic message
+	 * @param file
+	 *            the file or directory that was transferred
+	 * @return the localized reply
+	 */
+	public static LocalizedFileActionFtpReply translate(FtpIoSession session,
+		FtpRequest request, FtpServerContext context, int code, String subId,
+		String basicMsg, FtpFile file) {
+		String msg = FtpReplyTranslator.translateMessage(session, request,
+			context, code, subId, basicMsg);
+
+		return new LocalizedFileActionFtpReply(code, msg, file);
+	}
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java b/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java
index b67a83e..f822506 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/LocalizedRenameFtpReply.java
@@ -1,103 +1,103 @@
-/*
- * 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.ftpserver.impl;
-
-import org.apache.ftpserver.ftplet.FtpFile;
-import org.apache.ftpserver.ftplet.FtpRequest;
-import org.apache.ftpserver.ftplet.RenameFtpReply;
-
-/**
- * An implementation of <code>RenameFtpReply</code> that is sent when a file
- * or directory is renamed.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public class LocalizedRenameFtpReply extends LocalizedFtpReply implements
-	RenameFtpReply {
-
-	/**
-	 * The from file
-	 */
-	private final FtpFile from;
-
-	/**
-	 * The to file
-	 */
-	private final FtpFile to;
-
-	/**
-	 * Creates a new instance of <code>LocalizedRenameFtpReply</code>.
-	 * 
-	 * @param code
-	 *            the reply code
-	 * @param message
-	 *            the detailed message
-	 * @param from
-	 *            the old file
-	 * @param to
-	 *            the new file
-	 */
-	public LocalizedRenameFtpReply(int code, String message, FtpFile from,
-		FtpFile to) {
-		super(code, message);
-		this.from = from;
-		this.to = to;
-	}
-
-	public FtpFile getFrom() {
-		return from;
-	}
-
-	public FtpFile getTo() {
-		return to;
-	}
-
-	/**
-	 * Returns the localized reply that contains all details about the rename
-	 * operation.
-	 * 
-	 * @param session
-	 *            the FTP session
-	 * @param request
-	 *            the FTP request
-	 * @param context
-	 *            the FTP server context
-	 * @param code
-	 *            the reply code
-	 * @param subId
-	 *            the sub message ID
-	 * @param basicMsg
-	 *            the basic message
-	 * @param from
-	 *            the file or directory as it was before the rename
-	 * @param to
-	 *            the file or directory after the rename
-	 * @return the localized reply
-	 */
-	public static LocalizedRenameFtpReply translate(FtpIoSession session,
-		FtpRequest request, FtpServerContext context, int code, String subId,
-		String basicMsg, FtpFile from, FtpFile to) {
-		String msg = FtpReplyTranslator.translateMessage(session, request,
-			context, code, subId, basicMsg);
-		return new LocalizedRenameFtpReply(code, msg, from, to);
-	}
-}
+/*
+ * 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.ftpserver.impl;
+
+import org.apache.ftpserver.ftplet.FtpFile;
+import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.RenameFtpReply;
+
+/**
+ * An implementation of <code>RenameFtpReply</code> that is sent when a file
+ * or directory is renamed.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public class LocalizedRenameFtpReply extends LocalizedFtpReply implements
+	RenameFtpReply {
+
+	/**
+	 * The from file
+	 */
+	private final FtpFile from;
+
+	/**
+	 * The to file
+	 */
+	private final FtpFile to;
+
+	/**
+	 * Creates a new instance of <code>LocalizedRenameFtpReply</code>.
+	 * 
+	 * @param code
+	 *            the reply code
+	 * @param message
+	 *            the detailed message
+	 * @param from
+	 *            the old file
+	 * @param to
+	 *            the new file
+	 */
+	public LocalizedRenameFtpReply(int code, String message, FtpFile from,
+		FtpFile to) {
+		super(code, message);
+		this.from = from;
+		this.to = to;
+	}
+
+	public FtpFile getFrom() {
+		return from;
+	}
+
+	public FtpFile getTo() {
+		return to;
+	}
+
+	/**
+	 * Returns the localized reply that contains all details about the rename
+	 * operation.
+	 * 
+	 * @param session
+	 *            the FTP session
+	 * @param request
+	 *            the FTP request
+	 * @param context
+	 *            the FTP server context
+	 * @param code
+	 *            the reply code
+	 * @param subId
+	 *            the sub message ID
+	 * @param basicMsg
+	 *            the basic message
+	 * @param from
+	 *            the file or directory as it was before the rename
+	 * @param to
+	 *            the file or directory after the rename
+	 * @return the localized reply
+	 */
+	public static LocalizedRenameFtpReply translate(FtpIoSession session,
+		FtpRequest request, FtpServerContext context, int code, String subId,
+		String basicMsg, FtpFile from, FtpFile to) {
+		String msg = FtpReplyTranslator.translateMessage(session, request,
+			context, code, subId, basicMsg);
+		return new LocalizedRenameFtpReply(code, msg, from, to);
+	}
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/main/java/org/apache/ftpserver/ipfilter/MinaSessionFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/ipfilter/MinaSessionFilter.java b/core/src/main/java/org/apache/ftpserver/ipfilter/MinaSessionFilter.java
index 3a59f12..ee333b0 100644
--- a/core/src/main/java/org/apache/ftpserver/ipfilter/MinaSessionFilter.java
+++ b/core/src/main/java/org/apache/ftpserver/ipfilter/MinaSessionFilter.java
@@ -1,58 +1,58 @@
-/*
- * 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.ftpserver.ipfilter;
-
-import org.apache.mina.core.filterchain.IoFilterAdapter;
-import org.apache.mina.core.session.IoSession;
-
-/**
- * A wrapper for <code>SessionFilter</code> so it can be added to the MINA
- * filter chain.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public class MinaSessionFilter extends IoFilterAdapter {
-
-    /**
-     * The actual (or wrapped) <code>SessionFilter</code> used by this filter.
-     */
-    private final SessionFilter filter;
-
-    /**
-     * Creates a new instance of <code>MinaSessionFilter</code>.
-     * 
-     * @param filter
-     *            the filter
-     */
-    public MinaSessionFilter(SessionFilter filter) {
-        this.filter = filter;
-    }
-
-    @Override
-    public void sessionCreated(NextFilter nextFilter, IoSession session) {
-        if (!filter.accept(session)) {
-            session.close(true);
-        } else {
-            nextFilter.sessionCreated(session);
-        }
-    }
-}
+/*
+ * 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.ftpserver.ipfilter;
+
+import org.apache.mina.core.filterchain.IoFilterAdapter;
+import org.apache.mina.core.session.IoSession;
+
+/**
+ * A wrapper for <code>SessionFilter</code> so it can be added to the MINA
+ * filter chain.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public class MinaSessionFilter extends IoFilterAdapter {
+
+    /**
+     * The actual (or wrapped) <code>SessionFilter</code> used by this filter.
+     */
+    private final SessionFilter filter;
+
+    /**
+     * Creates a new instance of <code>MinaSessionFilter</code>.
+     * 
+     * @param filter
+     *            the filter
+     */
+    public MinaSessionFilter(SessionFilter filter) {
+        this.filter = filter;
+    }
+
+    @Override
+    public void sessionCreated(NextFilter nextFilter, IoSession session) {
+        if (!filter.accept(session)) {
+            session.close(true);
+        } else {
+            nextFilter.sessionCreated(session);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/main/java/org/apache/ftpserver/ipfilter/RemoteIpFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/ipfilter/RemoteIpFilter.java b/core/src/main/java/org/apache/ftpserver/ipfilter/RemoteIpFilter.java
index a51b159..8a1b036 100644
--- a/core/src/main/java/org/apache/ftpserver/ipfilter/RemoteIpFilter.java
+++ b/core/src/main/java/org/apache/ftpserver/ipfilter/RemoteIpFilter.java
@@ -1,223 +1,223 @@
-/*
- * 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.ftpserver.ipfilter;
-
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-import org.apache.mina.core.session.IoSession;
-import org.apache.mina.filter.firewall.Subnet;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * An implementation of the <code>SessionFilter</code> interface, to filter
- * sessions based on the remote IP address.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public class RemoteIpFilter extends CopyOnWriteArraySet<Subnet> implements
-        SessionFilter {
-
-    /**
-     * Logger
-     */
-    Logger LOGGER = LoggerFactory.getLogger(RemoteIpFilter.class);
-
-    /**
-     * Serial version UID
-     */
-    private static final long serialVersionUID = 4887092372700628783L;
-
-    /**
-     * filter type
-     */
-    private IpFilterType type = null;
-
-    /**
-     * Creates a new instance of <code>RemoteIpFilter</code>.
-     * 
-     * @param type
-     *            the filter type
-     */
-    public RemoteIpFilter(IpFilterType type) {
-        this(type, new HashSet<Subnet>(0));
-    }
-
-    /**
-     * Creates a new instance of <code>RemoteIpFilter</code>.
-     * 
-     * @param type
-     *            the filter type
-     * @param collection
-     *            a collection of <code>Subnet</code>s to filter out/in.
-     */
-    public RemoteIpFilter(IpFilterType type,
-            Collection<? extends Subnet> collection) {
-        super(collection);
-        this.type = type;
-    }
-
-    /**
-     * Creates a new instance of <code>RemoteIpFilter</code>.
-     * 
-     * @param type
-     *            the filter type
-     * @param addresses
-     *            a comma, space, tab, CR, LF separated list of IP
-     *            addresses/CIDRs.
-     * @throws UnknownHostException
-     *             propagated
-     * @throws NumberFormatException
-     *             propagated
-     */
-    public RemoteIpFilter(IpFilterType type, String addresses)
-            throws NumberFormatException, UnknownHostException {
-        super();
-        this.type = type;
-        if (addresses != null) {
-            String[] tokens = addresses.split("[\\s,]+");
-            for (String token : tokens) {
-                if (token.trim().length() > 0) {
-                    add(token);
-                }
-            }
-        }
-        if (LOGGER.isDebugEnabled()) {
-            LOGGER.debug(
-                    "Created DefaultIpFilter of type {} with the subnets {}",
-                    type, this);
-        }
-    }
-
-    /**
-     * Returns the type of this filter.
-     * 
-     * @return the type of this filter.
-     */
-    public IpFilterType getType() {
-        return type;
-    }
-
-    /**
-     * Sets the type of this filter.
-     * 
-     * @param type
-     *            the type of this filter.
-     */
-    public void setType(IpFilterType type) {
-        this.type = type;
-    }
-
-    /**
-     * Adds the given string representation of InetAddress or CIDR notation to
-     * this filter.
-     * 
-     * @param str
-     *            the string representation of InetAddress or CIDR notation
-     * @return if the given element was added or not. <code>true</code>, if the
-     *         given element was added to the filter; <code>false</code>, if the
-     *         element already exists in the filter.
-     * @throws NumberFormatException
-     *             propagated
-     * @throws UnknownHostException
-     *             propagated
-     */
-    public boolean add(String str) throws NumberFormatException,
-            UnknownHostException {
-        // This is required so we do not block loopback address if some one adds
-        // a string with blanks as the InetAddress class assumes loopback
-        // address on a blank string.
-        if (str.trim().length() < 1) {
-            throw new IllegalArgumentException("Invalid IP Address or Subnet: "
-                    + str);
-        }
-        String[] tokens = str.split("/");
-        if (tokens.length == 2) {
-            return add(new Subnet(InetAddress.getByName(tokens[0]), Integer
-                    .parseInt(tokens[1])));
-        } else {
-            return add(new Subnet(InetAddress.getByName(tokens[0]), 32));
-        }
-    }
-
-    public boolean accept(IoSession session) {
-        InetAddress address = ((InetSocketAddress) session.getRemoteAddress())
-                .getAddress();
-        switch (type) {
-        case ALLOW:
-            for (Subnet subnet : this) {
-                if (subnet.inSubnet(address)) {
-                    if (LOGGER.isDebugEnabled()) {
-                        LOGGER
-                                .debug(
-                                        "Allowing connection from {} because it matches with the whitelist subnet {}",
-                                        new Object[] { address, subnet });
-                    }
-                    return true;
-                }
-            }
-            if (LOGGER.isDebugEnabled()) {
-                LOGGER
-                        .debug(
-                                "Denying connection from {} because it does not match any of the whitelist subnets",
-                                new Object[] { address });
-            }
-            return false;
-        case DENY:
-            if (isEmpty()) {
-                if (LOGGER.isDebugEnabled()) {
-                    LOGGER
-                            .debug(
-                                    "Allowing connection from {} because blacklist is empty",
-                                    new Object[] { address });
-                }
-                return true;
-            }
-            for (Subnet subnet : this) {
-                if (subnet.inSubnet(address)) {
-                    if (LOGGER.isDebugEnabled()) {
-                        LOGGER
-                                .debug(
-                                        "Denying connection from {} because it matches with the blacklist subnet {}",
-                                        new Object[] { address, subnet });
-                    }
-                    return false;
-                }
-            }
-            if (LOGGER.isDebugEnabled()) {
-                LOGGER
-                        .debug(
-                                "Allowing connection from {} because it does not match any of the blacklist subnets",
-                                new Object[] { address });
-            }
-            return true;
-        default:
-            throw new RuntimeException("Unknown or unimplemented filter type: "
-                    + type);
-        }
-    }
-}
+/*
+ * 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.ftpserver.ipfilter;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.concurrent.CopyOnWriteArraySet;
+
+import org.apache.mina.core.session.IoSession;
+import org.apache.mina.filter.firewall.Subnet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * An implementation of the <code>SessionFilter</code> interface, to filter
+ * sessions based on the remote IP address.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public class RemoteIpFilter extends CopyOnWriteArraySet<Subnet> implements
+        SessionFilter {
+
+    /**
+     * Logger
+     */
+    Logger LOGGER = LoggerFactory.getLogger(RemoteIpFilter.class);
+
+    /**
+     * Serial version UID
+     */
+    private static final long serialVersionUID = 4887092372700628783L;
+
+    /**
+     * filter type
+     */
+    private IpFilterType type = null;
+
+    /**
+     * Creates a new instance of <code>RemoteIpFilter</code>.
+     * 
+     * @param type
+     *            the filter type
+     */
+    public RemoteIpFilter(IpFilterType type) {
+        this(type, new HashSet<Subnet>(0));
+    }
+
+    /**
+     * Creates a new instance of <code>RemoteIpFilter</code>.
+     * 
+     * @param type
+     *            the filter type
+     * @param collection
+     *            a collection of <code>Subnet</code>s to filter out/in.
+     */
+    public RemoteIpFilter(IpFilterType type,
+            Collection<? extends Subnet> collection) {
+        super(collection);
+        this.type = type;
+    }
+
+    /**
+     * Creates a new instance of <code>RemoteIpFilter</code>.
+     * 
+     * @param type
+     *            the filter type
+     * @param addresses
+     *            a comma, space, tab, CR, LF separated list of IP
+     *            addresses/CIDRs.
+     * @throws UnknownHostException
+     *             propagated
+     * @throws NumberFormatException
+     *             propagated
+     */
+    public RemoteIpFilter(IpFilterType type, String addresses)
+            throws NumberFormatException, UnknownHostException {
+        super();
+        this.type = type;
+        if (addresses != null) {
+            String[] tokens = addresses.split("[\\s,]+");
+            for (String token : tokens) {
+                if (token.trim().length() > 0) {
+                    add(token);
+                }
+            }
+        }
+        if (LOGGER.isDebugEnabled()) {
+            LOGGER.debug(
+                    "Created DefaultIpFilter of type {} with the subnets {}",
+                    type, this);
+        }
+    }
+
+    /**
+     * Returns the type of this filter.
+     * 
+     * @return the type of this filter.
+     */
+    public IpFilterType getType() {
+        return type;
+    }
+
+    /**
+     * Sets the type of this filter.
+     * 
+     * @param type
+     *            the type of this filter.
+     */
+    public void setType(IpFilterType type) {
+        this.type = type;
+    }
+
+    /**
+     * Adds the given string representation of InetAddress or CIDR notation to
+     * this filter.
+     * 
+     * @param str
+     *            the string representation of InetAddress or CIDR notation
+     * @return if the given element was added or not. <code>true</code>, if the
+     *         given element was added to the filter; <code>false</code>, if the
+     *         element already exists in the filter.
+     * @throws NumberFormatException
+     *             propagated
+     * @throws UnknownHostException
+     *             propagated
+     */
+    public boolean add(String str) throws NumberFormatException,
+            UnknownHostException {
+        // This is required so we do not block loopback address if some one adds
+        // a string with blanks as the InetAddress class assumes loopback
+        // address on a blank string.
+        if (str.trim().length() < 1) {
+            throw new IllegalArgumentException("Invalid IP Address or Subnet: "
+                    + str);
+        }
+        String[] tokens = str.split("/");
+        if (tokens.length == 2) {
+            return add(new Subnet(InetAddress.getByName(tokens[0]), Integer
+                    .parseInt(tokens[1])));
+        } else {
+            return add(new Subnet(InetAddress.getByName(tokens[0]), 32));
+        }
+    }
+
+    public boolean accept(IoSession session) {
+        InetAddress address = ((InetSocketAddress) session.getRemoteAddress())
+                .getAddress();
+        switch (type) {
+        case ALLOW:
+            for (Subnet subnet : this) {
+                if (subnet.inSubnet(address)) {
+                    if (LOGGER.isDebugEnabled()) {
+                        LOGGER
+                                .debug(
+                                        "Allowing connection from {} because it matches with the whitelist subnet {}",
+                                        new Object[] { address, subnet });
+                    }
+                    return true;
+                }
+            }
+            if (LOGGER.isDebugEnabled()) {
+                LOGGER
+                        .debug(
+                                "Denying connection from {} because it does not match any of the whitelist subnets",
+                                new Object[] { address });
+            }
+            return false;
+        case DENY:
+            if (isEmpty()) {
+                if (LOGGER.isDebugEnabled()) {
+                    LOGGER
+                            .debug(
+                                    "Allowing connection from {} because blacklist is empty",
+                                    new Object[] { address });
+                }
+                return true;
+            }
+            for (Subnet subnet : this) {
+                if (subnet.inSubnet(address)) {
+                    if (LOGGER.isDebugEnabled()) {
+                        LOGGER
+                                .debug(
+                                        "Denying connection from {} because it matches with the blacklist subnet {}",
+                                        new Object[] { address, subnet });
+                    }
+                    return false;
+                }
+            }
+            if (LOGGER.isDebugEnabled()) {
+                LOGGER
+                        .debug(
+                                "Allowing connection from {} because it does not match any of the blacklist subnets",
+                                new Object[] { address });
+            }
+            return true;
+        default:
+            throw new RuntimeException("Unknown or unimplemented filter type: "
+                    + type);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/test/java/org/apache/ftpserver/clienttests/ActiveModeReplyTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/clienttests/ActiveModeReplyTest.java b/core/src/test/java/org/apache/ftpserver/clienttests/ActiveModeReplyTest.java
index 9d1138f..ed02174 100644
--- a/core/src/test/java/org/apache/ftpserver/clienttests/ActiveModeReplyTest.java
+++ b/core/src/test/java/org/apache/ftpserver/clienttests/ActiveModeReplyTest.java
@@ -1,79 +1,79 @@
-/*
- * 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.ftpserver.clienttests;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.commons.net.ftp.FTPClient;
-import org.apache.commons.net.ftp.FTPClientConfig;
-import org.apache.ftpserver.test.TestUtil;
-
-/**
-*
-* @author <a href="http://mina.apache.org">Apache MINA Project</a>
-*
-*/
-public class ActiveModeReplyTest extends ClientTestTemplate {
-    private static final File TEST_TMP_DIR = new File("test-tmp");
-
-    private static final File TEST_FILE = new File(ROOT_DIR, "test.txt");
-
-    private static final File TEST_FILE1 = new File(TEST_TMP_DIR, "test1.txt");
-
-    private static byte[] testData;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        TEST_FILE1.createNewFile();
-        assertTrue(TEST_FILE1.exists());
-
-        testData = ("TESTDATA").getBytes("UTF-8");
-        TestUtil.writeDataToFile(TEST_FILE, testData);
-        assertTrue(TEST_FILE.exists());
-
-        FTPClientConfig config = new FTPClientConfig("UNIX");
-        client.configure(config);
-
-        client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
-    }
-
-    public void testStoreInActiveModeIfNotAllowed() throws Exception {
-        assertTrue(client.getDataConnectionMode() == FTPClient.ACTIVE_LOCAL_DATA_CONNECTION_MODE);
-
-        sendCommand("APPE " + TEST_FILE1.getAbsolutePath());
-        sendCommand("LIST");
-        sendCommand("MLSD");
-        sendCommand("NLST");
-        sendCommand("RETR " + TEST_FILE.getName());
-        sendCommand("STOR " + TEST_FILE1.getAbsolutePath());
-        sendCommand("STOU");
-    }
-
-    private void sendCommand(final String command) throws IOException {
-        final int returnCode = client.sendCommand(command);
-        assertEquals(503, returnCode);
-        assertEquals("503 PORT or PASV must be issued first", client
-                .getReplyString().trim());
-    }
-
-}
+/*
+ * 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.ftpserver.clienttests;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.net.ftp.FTPClient;
+import org.apache.commons.net.ftp.FTPClientConfig;
+import org.apache.ftpserver.test.TestUtil;
+
+/**
+*
+* @author <a href="http://mina.apache.org">Apache MINA Project</a>
+*
+*/
+public class ActiveModeReplyTest extends ClientTestTemplate {
+    private static final File TEST_TMP_DIR = new File("test-tmp");
+
+    private static final File TEST_FILE = new File(ROOT_DIR, "test.txt");
+
+    private static final File TEST_FILE1 = new File(TEST_TMP_DIR, "test1.txt");
+
+    private static byte[] testData;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        TEST_FILE1.createNewFile();
+        assertTrue(TEST_FILE1.exists());
+
+        testData = ("TESTDATA").getBytes("UTF-8");
+        TestUtil.writeDataToFile(TEST_FILE, testData);
+        assertTrue(TEST_FILE.exists());
+
+        FTPClientConfig config = new FTPClientConfig("UNIX");
+        client.configure(config);
+
+        client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
+    }
+
+    public void testStoreInActiveModeIfNotAllowed() throws Exception {
+        assertTrue(client.getDataConnectionMode() == FTPClient.ACTIVE_LOCAL_DATA_CONNECTION_MODE);
+
+        sendCommand("APPE " + TEST_FILE1.getAbsolutePath());
+        sendCommand("LIST");
+        sendCommand("MLSD");
+        sendCommand("NLST");
+        sendCommand("RETR " + TEST_FILE.getName());
+        sendCommand("STOR " + TEST_FILE1.getAbsolutePath());
+        sendCommand("STOU");
+    }
+
+    private void sendCommand(final String command) throws IOException {
+        final int returnCode = client.sendCommand(command);
+        assertEquals(503, returnCode);
+        assertEquals("503 PORT or PASV must be issued first", client
+                .getReplyString().trim());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9769d29a/core/src/test/java/org/apache/ftpserver/clienttests/PasvAddressWithOverridenHostnameGetter.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/clienttests/PasvAddressWithOverridenHostnameGetter.java b/core/src/test/java/org/apache/ftpserver/clienttests/PasvAddressWithOverridenHostnameGetter.java
index 1d0419e..f5e9409 100644
--- a/core/src/test/java/org/apache/ftpserver/clienttests/PasvAddressWithOverridenHostnameGetter.java
+++ b/core/src/test/java/org/apache/ftpserver/clienttests/PasvAddressWithOverridenHostnameGetter.java
@@ -1,73 +1,73 @@
-/*
- * 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.ftpserver.clienttests;
-
-import org.apache.ftpserver.DataConnectionConfigurationFactory;
-import org.apache.ftpserver.FtpServerFactory;
-import org.apache.ftpserver.command.CommandFactoryFactory;
-import org.apache.ftpserver.command.impl.PASV;
-import org.apache.ftpserver.impl.FtpIoSession;
-import org.apache.ftpserver.listener.ListenerFactory;
-
-/**
- * Test for external passive address configured as hostname rather than IP
- * address.
- *
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * @version $Rev$, $Date$
- *
- */
-public class PasvAddressWithOverridenHostnameGetter extends ClientTestTemplate {
-
-    class PASVTest extends PASV{
-
-        @Override
-        protected String getPassiveExternalAddress(FtpIoSession session) {
-            return "10.10.10.10";
-        }
-        
-    }
-    @Override
-    protected FtpServerFactory createServer() throws Exception {
-        FtpServerFactory server = super.createServer();
-
-        ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
-        
-        DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();
-
-        dccFactory.setPassiveExternalAddress("127.0.0.1");
-
-        listenerFactory.setDataConnectionConfiguration(dccFactory.createDataConnectionConfiguration());
-
-        server.addListener("default", listenerFactory.createListener());
-        CommandFactoryFactory cmFact = new CommandFactoryFactory();
-        cmFact.setUseDefaultCommands(true);
-        cmFact.addCommand("PASV", new PASVTest());
-        server.setCommandFactory(cmFact.createCommandFactory());
-        return server;
-    }
-
-    public void testPasvAddress() throws Exception {
-        client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
-        client.pasv();
-
-        assertTrue(client.getReplyString().indexOf("(10,10,10,10,") > -1);
-    }
-}
+/*
+ * 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.ftpserver.clienttests;
+
+import org.apache.ftpserver.DataConnectionConfigurationFactory;
+import org.apache.ftpserver.FtpServerFactory;
+import org.apache.ftpserver.command.CommandFactoryFactory;
+import org.apache.ftpserver.command.impl.PASV;
+import org.apache.ftpserver.impl.FtpIoSession;
+import org.apache.ftpserver.listener.ListenerFactory;
+
+/**
+ * Test for external passive address configured as hostname rather than IP
+ * address.
+ *
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * @version $Rev$, $Date$
+ *
+ */
+public class PasvAddressWithOverridenHostnameGetter extends ClientTestTemplate {
+
+    class PASVTest extends PASV{
+
+        @Override
+        protected String getPassiveExternalAddress(FtpIoSession session) {
+            return "10.10.10.10";
+        }
+        
+    }
+    @Override
+    protected FtpServerFactory createServer() throws Exception {
+        FtpServerFactory server = super.createServer();
+
+        ListenerFactory listenerFactory = new ListenerFactory(server.getListener("default"));
+        
+        DataConnectionConfigurationFactory dccFactory = new DataConnectionConfigurationFactory();
+
+        dccFactory.setPassiveExternalAddress("127.0.0.1");
+
+        listenerFactory.setDataConnectionConfiguration(dccFactory.createDataConnectionConfiguration());
+
+        server.addListener("default", listenerFactory.createListener());
+        CommandFactoryFactory cmFact = new CommandFactoryFactory();
+        cmFact.setUseDefaultCommands(true);
+        cmFact.addCommand("PASV", new PASVTest());
+        server.setCommandFactory(cmFact.createCommandFactory());
+        return server;
+    }
+
+    public void testPasvAddress() throws Exception {
+        client.login(ADMIN_USERNAME, ADMIN_PASSWORD);
+        client.pasv();
+
+        assertTrue(client.getReplyString().indexOf("(10,10,10,10,") > -1);
+    }
+}


[16/50] [abbrv] git commit: Explicit boxing

Posted by ng...@apache.org.
Explicit boxing

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129762 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/de4899f3
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/de4899f3
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/de4899f3

Branch: refs/heads/trunk
Commit: de4899f3a24a86ed8731ee5161065d5c2795b43b
Parents: 03b260e
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:35:37 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:35:37 2011 +0000

----------------------------------------------------------------------
 .../java/org/apache/ftpserver/impl/PassivePorts.java    | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/de4899f3/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java b/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
index 7926178..f539540 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/PassivePorts.java
@@ -38,6 +38,8 @@ public class PassivePorts {
 
     private static final int MAX_PORT = 65535;
 
+    private static final Integer MAX_PORT_INTEGER = Integer.valueOf(MAX_PORT);
+
     private int[] passivePorts;
 
     private boolean[] reservedPorts;
@@ -64,18 +66,18 @@ public class PassivePorts {
         List<Integer> passivePortsList = new ArrayList<Integer>();
 
         boolean inRange = false;
-        Integer lastPort = 1;
+        Integer lastPort = Integer.valueOf(1);
         StringTokenizer st = new StringTokenizer(portsString, ",;-", true);
         while (st.hasMoreTokens()) {
             String token = st.nextToken().trim();
 
             if (",".equals(token) || ";".equals(token)) {
                 if (inRange) {
-                    fillRange(passivePortsList, lastPort, MAX_PORT);
+                    fillRange(passivePortsList, lastPort, MAX_PORT_INTEGER);
                 }
 
                 // reset state
-                lastPort = 1;
+                lastPort = Integer.valueOf(1);
                 inRange = false;
             } else if ("-".equals(token)) {
                 inRange = true;
@@ -100,7 +102,7 @@ public class PassivePorts {
         }
 
         if (inRange) {
-            fillRange(passivePortsList, lastPort, MAX_PORT);
+            fillRange(passivePortsList, lastPort, MAX_PORT_INTEGER);
         }
 
         int[] passivePorts = new int[passivePortsList.size()];
@@ -123,7 +125,7 @@ public class PassivePorts {
     private static void fillRange(final List<Integer> passivePortsList,
             final Integer beginPort, final Integer endPort) {
         for (int i = beginPort.intValue(); i <= endPort.intValue(); i++) {
-            addPort(passivePortsList, i);
+            addPort(passivePortsList, Integer.valueOf(i));
         }
     }
 


[31/50] [abbrv] git commit: Reduce logging level for normal testing

Posted by ng...@apache.org.
Reduce logging level for normal testing

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1130116 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/baa2fd8d
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/baa2fd8d
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/baa2fd8d

Branch: refs/heads/trunk
Commit: baa2fd8df1d1e2d7c815f1482f15e3faa9bda7dc
Parents: 222f2fc
Author: Sebastian Bazley <se...@apache.org>
Authored: Wed Jun 1 11:59:32 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Wed Jun 1 11:59:32 2011 +0000

----------------------------------------------------------------------
 core/src/test/resources/log4j.properties | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/baa2fd8d/core/src/test/resources/log4j.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/log4j.properties b/core/src/test/resources/log4j.properties
index 32830e8..bbe7336 100644
--- a/core/src/test/resources/log4j.properties
+++ b/core/src/test/resources/log4j.properties
@@ -15,7 +15,7 @@
 # specific language governing permissions and limitations
 # under the License.
 
-log4j.rootLogger=DEBUG, C 
+log4j.rootLogger=WARN, C 
 log4j.appender.C=org.apache.log4j.ConsoleAppender 
 log4j.appender.C.layout=org.apache.log4j.PatternLayout 
 log4j.appender.C.layout.ConversionPattern=[%X{userName}] [%X{remoteIp}] [%X{session}] %m%n


[02/50] [abbrv] git commit: Unused imports

Posted by ng...@apache.org.
Unused imports

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129716 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/9fb567a2
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/9fb567a2
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/9fb567a2

Branch: refs/heads/trunk
Commit: 9fb567a25d71ccd47d84b894cbc8570b3d216242
Parents: 73f4e1e
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 14:48:25 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 14:48:25 2011 +0000

----------------------------------------------------------------------
 core/src/main/java/org/apache/ftpserver/command/impl/MKD.java      | 1 -
 core/src/main/java/org/apache/ftpserver/command/impl/SITE.java     | 1 -
 core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java     | 2 +-
 .../java/org/apache/ftpserver/impl/IODataConnectionFactory.java    | 1 -
 4 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9fb567a2/core/src/main/java/org/apache/ftpserver/command/impl/MKD.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/MKD.java b/core/src/main/java/org/apache/ftpserver/command/impl/MKD.java
index 19c118d..bd82b0d 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/MKD.java
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/MKD.java
@@ -19,7 +19,6 @@
 
 package org.apache.ftpserver.command.impl;
 
-import java.io.File;
 import java.io.IOException;
 
 import org.apache.ftpserver.command.AbstractCommand;

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9fb567a2/core/src/main/java/org/apache/ftpserver/command/impl/SITE.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/SITE.java b/core/src/main/java/org/apache/ftpserver/command/impl/SITE.java
index 7bc106f..d60f6ff 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/SITE.java
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/SITE.java
@@ -20,7 +20,6 @@
 package org.apache.ftpserver.command.impl;
 
 import java.io.IOException;
-import java.util.HashMap;
 
 import org.apache.ftpserver.command.AbstractCommand;
 import org.apache.ftpserver.command.Command;

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9fb567a2/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java b/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java
index d2cd6e5..330c387 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/FtpIoSession.java
@@ -50,7 +50,7 @@ import org.apache.mina.core.session.IoSessionConfig;
 import org.apache.mina.core.write.WriteRequest;
 import org.apache.mina.core.write.WriteRequestQueue;
 import org.apache.mina.filter.ssl.SslFilter;
-import org.slf4j.Logger;
+
 import org.slf4j.LoggerFactory;
 
 /**

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/9fb567a2/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java b/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java
index 01558d2..90a321e 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/IODataConnectionFactory.java
@@ -26,7 +26,6 @@ import java.net.Socket;
 import java.net.SocketAddress;
 import java.net.UnknownHostException;
 
-import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
 


[25/50] [abbrv] git commit: eol-style

Posted by ng...@apache.org.
eol-style

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129830 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/358f8e6c
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/358f8e6c
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/358f8e6c

Branch: refs/heads/trunk
Commit: 358f8e6c4b3b3b55986ffc2849f695127cd82dfe
Parents: 9769d29
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 17:59:55 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 17:59:55 2011 +0000

----------------------------------------------------------------------
 .../ftpserver/command/impl/listing/package.html     | 16 ++++++++--------
 .../org/apache/ftpserver/command/impl/package.html  | 16 ++++++++--------
 .../org/apache/ftpserver/config/spring/package.html | 16 ++++++++--------
 .../ftpserver/filesystem/nativefs/impl/package.html | 16 ++++++++--------
 .../ftpserver/ftpletcontainer/impl/package.html     | 16 ++++++++--------
 .../java/org/apache/ftpserver/impl/package.html     | 14 +++++++-------
 .../org/apache/ftpserver/listener/nio/package.html  | 16 ++++++++--------
 .../org/apache/ftpserver/message/impl/package.html  | 16 ++++++++--------
 .../java/org/apache/ftpserver/ssl/impl/package.html | 16 ++++++++--------
 9 files changed, 71 insertions(+), 71 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/command/impl/listing/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/listing/package.html b/core/src/main/java/org/apache/ftpserver/command/impl/listing/package.html
index 8734645..4a250c2 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/listing/package.html
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/listing/package.html
@@ -14,12 +14,12 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-<p>File listing implementations used by various FTP commands</p> 
-</body>
-</html>
+<p>File listing implementations used by various FTP commands</p> 
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/command/impl/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/command/impl/package.html b/core/src/main/java/org/apache/ftpserver/command/impl/package.html
index dc9e0e9..399ab0f 100644
--- a/core/src/main/java/org/apache/ftpserver/command/impl/package.html
+++ b/core/src/main/java/org/apache/ftpserver/command/impl/package.html
@@ -14,12 +14,12 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-<p>FTP command implementations</p> 
-</body>
-</html>
+<p>FTP command implementations</p> 
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/config/spring/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/config/spring/package.html b/core/src/main/java/org/apache/ftpserver/config/spring/package.html
index e31fac2..ca4f67d 100644
--- a/core/src/main/java/org/apache/ftpserver/config/spring/package.html
+++ b/core/src/main/java/org/apache/ftpserver/config/spring/package.html
@@ -14,12 +14,12 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-<p>Support classes for Spring based XML configuration</p> 
-</body>
-</html>
+<p>Support classes for Spring based XML configuration</p> 
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/package.html b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/package.html
index a9cc708..e1d20c0 100644
--- a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/package.html
+++ b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/package.html
@@ -14,12 +14,12 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-<p>Native file system implementation</p> 
-</body>
-</html>
+<p>Native file system implementation</p> 
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/ftpletcontainer/impl/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/ftpletcontainer/impl/package.html b/core/src/main/java/org/apache/ftpserver/ftpletcontainer/impl/package.html
index af5f8f7..baac85c 100644
--- a/core/src/main/java/org/apache/ftpserver/ftpletcontainer/impl/package.html
+++ b/core/src/main/java/org/apache/ftpserver/ftpletcontainer/impl/package.html
@@ -14,12 +14,12 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-<p>Ftplet container implementation</p> 
-</body>
-</html>
+<p>Ftplet container implementation</p> 
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/impl/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/package.html b/core/src/main/java/org/apache/ftpserver/impl/package.html
index fe172dc..42822ef 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/package.html
+++ b/core/src/main/java/org/apache/ftpserver/impl/package.html
@@ -14,11 +14,11 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-</body>
-</html>
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/listener/nio/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/listener/nio/package.html b/core/src/main/java/org/apache/ftpserver/listener/nio/package.html
index 95f1bfd..324c729 100644
--- a/core/src/main/java/org/apache/ftpserver/listener/nio/package.html
+++ b/core/src/main/java/org/apache/ftpserver/listener/nio/package.html
@@ -14,12 +14,12 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-<p>NIO based listener</p> 
-</body>
-</html>
+<p>NIO based listener</p> 
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/message/impl/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/message/impl/package.html b/core/src/main/java/org/apache/ftpserver/message/impl/package.html
index 2e2d7a0..ce5c901 100644
--- a/core/src/main/java/org/apache/ftpserver/message/impl/package.html
+++ b/core/src/main/java/org/apache/ftpserver/message/impl/package.html
@@ -14,12 +14,12 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-<p>Message resource implementation</p> 
-</body>
-</html>
+<p>Message resource implementation</p> 
+</body>
+</html>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/358f8e6c/core/src/main/java/org/apache/ftpserver/ssl/impl/package.html
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/ssl/impl/package.html b/core/src/main/java/org/apache/ftpserver/ssl/impl/package.html
index 309251e..9db0d2b 100644
--- a/core/src/main/java/org/apache/ftpserver/ssl/impl/package.html
+++ b/core/src/main/java/org/apache/ftpserver/ssl/impl/package.html
@@ -14,12 +14,12 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-</head>
-<body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+</head>
+<body>
 <strong>Internal classes, do not use directly!</strong>
-<p>SSL support implementation</p> 
-</body>
-</html>
+<p>SSL support implementation</p> 
+</body>
+</html>


[03/50] [abbrv] git commit: Javadoc fixes

Posted by ng...@apache.org.
Javadoc fixes

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129717 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/b71a25f9
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/b71a25f9
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/b71a25f9

Branch: refs/heads/trunk
Commit: b71a25f923e5406e820f1043a45f5a3da8db838e
Parents: 9fb567a
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 14:48:57 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 14:48:57 2011 +0000

----------------------------------------------------------------------
 .../apache/ftpserver/DataConnectionConfigurationFactory.java  | 2 +-
 core/src/main/java/org/apache/ftpserver/FtpServerFactory.java | 7 -------
 .../org/apache/ftpserver/ftpletcontainer/FtpletContainer.java | 2 +-
 core/src/main/java/org/apache/ftpserver/impl/FtpHandler.java  | 4 ++--
 .../java/org/apache/ftpserver/listener/ListenerFactory.java   | 3 +--
 .../org/apache/ftpserver/listener/nio/FtpLoggingFilter.java   | 2 +-
 .../java/org/apache/ftpserver/ssl/impl/AliasKeyManager.java   | 4 +---
 7 files changed, 7 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b71a25f9/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java b/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
index 9834bfe..7349921 100644
--- a/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
+++ b/core/src/main/java/org/apache/ftpserver/DataConnectionConfigurationFactory.java
@@ -315,7 +315,7 @@ public class DataConnectionConfigurationFactory {
 
     /**
      * Set whether ssl is required for the data connection
-     * @param sslMandatory True if ssl is mandatory for the data connection
+     * @param implicitSsl True if ssl is mandatory for the data connection
      */
     public void setImplicitSsl(boolean implicitSsl) {
         this.implicitSsl = implicitSsl;

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b71a25f9/core/src/main/java/org/apache/ftpserver/FtpServerFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/FtpServerFactory.java b/core/src/main/java/org/apache/ftpserver/FtpServerFactory.java
index ae3120b..70883bd 100644
--- a/core/src/main/java/org/apache/ftpserver/FtpServerFactory.java
+++ b/core/src/main/java/org/apache/ftpserver/FtpServerFactory.java
@@ -44,8 +44,6 @@ public class FtpServerFactory {
 
     /**
      * Creates a server with the default configuration
-     * 
-     * @throws Exception
      */
     public FtpServerFactory() {
         serverContext = new DefaultFtpServerContext();
@@ -224,11 +222,6 @@ public class FtpServerFactory {
      * Set the message resource to be used with this server
      * @param connectionConfig The {@link ConnectionConfig} to be used
      *  by servers created by this factory
-     * 
-     * @param messageResource
-     *            The {@link MessageResource}
-     * @throws IllegalStateException
-     *             If a custom server context has been set
      */
     public void setConnectionConfig(final ConnectionConfig connectionConfig) {
         serverContext.setConnectionConfig(connectionConfig);

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b71a25f9/core/src/main/java/org/apache/ftpserver/ftpletcontainer/FtpletContainer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/ftpletcontainer/FtpletContainer.java b/core/src/main/java/org/apache/ftpserver/ftpletcontainer/FtpletContainer.java
index fb84971..c3366d2 100644
--- a/core/src/main/java/org/apache/ftpserver/ftpletcontainer/FtpletContainer.java
+++ b/core/src/main/java/org/apache/ftpserver/ftpletcontainer/FtpletContainer.java
@@ -33,7 +33,7 @@ import org.apache.ftpserver.ftplet.Ftplet;
 public interface FtpletContainer extends Ftplet {
 
     /**
-     * Retrive the {@link Ftplet} identified by the name (as provided in the
+     * Retrieve the {@link Ftplet} identified by the name (as provided in the
      * {@link #addFtplet(String, Ftplet)} method.
      * 
      * @param name

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b71a25f9/core/src/main/java/org/apache/ftpserver/impl/FtpHandler.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/FtpHandler.java b/core/src/main/java/org/apache/ftpserver/impl/FtpHandler.java
index 6d2ba88..9bc3963 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/FtpHandler.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/FtpHandler.java
@@ -49,8 +49,8 @@ public interface FtpHandler {
 
     /**
      * Invoked when a connection has been opened. This method is invoked after
-     * {@link #sessionCreated(IoSession)}. The biggest difference from
-     * {@link #sessionCreated(IoSession)} is that it's invoked from other thread
+     * {@link #sessionCreated(FtpIoSession)}. The biggest difference from
+     * {@link #sessionCreated(FtpIoSession)} is that it's invoked from other thread
      * than an I/O processor thread once thread modesl is configured properly.
      */
     void sessionOpened(FtpIoSession session) throws Exception;

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b71a25f9/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java b/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java
index 60a689b..96168e4 100644
--- a/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java
+++ b/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java
@@ -270,11 +270,10 @@ public class ListenerFactory {
     }
 
     /**
-     * @deprecated Replaced by the IpFilter.    
      * Sets the {@link Subnet}s that listeners created by this factory will block from connecting
      * @param blockedSubnets 
      *  The list of {@link Subnet}s
-     * @param blockedAddresses
+     * @deprecated Replaced by the IpFilter.    
      */
     @Deprecated
     public void setBlockedSubnets(List<Subnet> blockedSubnets) {

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b71a25f9/core/src/main/java/org/apache/ftpserver/listener/nio/FtpLoggingFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/listener/nio/FtpLoggingFilter.java b/core/src/main/java/org/apache/ftpserver/listener/nio/FtpLoggingFilter.java
index fba9f31..278311a 100644
--- a/core/src/main/java/org/apache/ftpserver/listener/nio/FtpLoggingFilter.java
+++ b/core/src/main/java/org/apache/ftpserver/listener/nio/FtpLoggingFilter.java
@@ -61,7 +61,7 @@ public class FtpLoggingFilter extends LoggingFilter {
     }
 
     /**
-     * @see LoggingFilter#messageReceived(org.apache.mina.core.IoFilter.NextFilter,
+     * @see LoggingFilter#messageReceived(org.apache.mina.core.filterchain.IoFilter.NextFilter,
      *      IoSession, Object)
      */
     @Override

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b71a25f9/core/src/main/java/org/apache/ftpserver/ssl/impl/AliasKeyManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/ssl/impl/AliasKeyManager.java b/core/src/main/java/org/apache/ftpserver/ssl/impl/AliasKeyManager.java
index ef52628..e00b9d0 100644
--- a/core/src/main/java/org/apache/ftpserver/ssl/impl/AliasKeyManager.java
+++ b/core/src/main/java/org/apache/ftpserver/ssl/impl/AliasKeyManager.java
@@ -49,11 +49,9 @@ public final class AliasKeyManager implements X509KeyManager {
      * 
      * @param mgr
      *            The X509KeyManager used as a delegate
-     * @param keyStore
-     * @param serverKeyAlias
+     * @param keyAlias
      *            The alias name of the server's keypair and supporting
      *            certificate chain
-     * @param keyAlias
      */
     public AliasKeyManager(KeyManager mgr, String keyAlias) {
         this.delegate = (X509KeyManager) mgr;


[43/50] [abbrv] git commit: Working around a bug in the IBM JVM which might cause a NPE in test tear down (FTPSERVER-422)

Posted by ng...@apache.org.
Working around a bug in the IBM JVM which might cause a NPE in test tear down (FTPSERVER-422)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1138754 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/d9528ddf
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/d9528ddf
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/d9528ddf

Branch: refs/heads/trunk
Commit: d9528ddff8c77010a6a8da5d5876db0407c37176
Parents: 4648493
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Thu Jun 23 07:35:20 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Thu Jun 23 07:35:20 2011 +0000

----------------------------------------------------------------------
 .../org/apache/ftpserver/clienttests/ClientTestTemplate.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/d9528ddf/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java b/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java
index 6ec9608..aad9d52 100644
--- a/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java
+++ b/core/src/test/java/org/apache/ftpserver/clienttests/ClientTestTemplate.java
@@ -227,7 +227,12 @@ public abstract class ClientTestTemplate extends TestCase {
         }
 
         if (server != null) {
-            server.stop();
+        	try {
+        		server.stop();
+        	} catch(NullPointerException e) {
+        		// a bug in the IBM JVM might cause Thread.interrupt() to throw an NPE
+        		// see http://www-01.ibm.com/support/docview.wss?uid=swg1IZ52037&wv=1
+        	}
         }
 
         cleanTmpDirs();


[18/50] [abbrv] git commit: Fix eol-style

Posted by ng...@apache.org.
Fix eol-style

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129821 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/60937771
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/60937771
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/60937771

Branch: refs/heads/trunk
Commit: 60937771b26f1c58c366fea9d0a78495d04c2a62
Parents: e95456b
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 17:42:13 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 17:42:13 2011 +0000

----------------------------------------------------------------------
 .../src/main/resources/users.properties         | 74 ++++++++++----------
 .../example/osgiservice/users.properties        | 74 ++++++++++----------
 2 files changed, 74 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/60937771/examples/ftpserver-example-spring-war/src/main/resources/users.properties
----------------------------------------------------------------------
diff --git a/examples/ftpserver-example-spring-war/src/main/resources/users.properties b/examples/ftpserver-example-spring-war/src/main/resources/users.properties
index 2aed0d1..52899ce 100644
--- a/examples/ftpserver-example-spring-war/src/main/resources/users.properties
+++ b/examples/ftpserver-example-spring-war/src/main/resources/users.properties
@@ -1,37 +1,37 @@
-# 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.
-
-# Password is "admin"
-ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3
-ftpserver.user.admin.homedirectory=/tmp
-ftpserver.user.admin.enableflag=true
-ftpserver.user.admin.writepermission=true
-ftpserver.user.admin.maxloginnumber=0
-ftpserver.user.admin.maxloginperip=0
-ftpserver.user.admin.idletime=0
-ftpserver.user.admin.uploadrate=0
-ftpserver.user.admin.downloadrate=0
-
-ftpserver.user.anonymous.userpassword=
-ftpserver.user.anonymous.homedirectory=/tmp
-ftpserver.user.anonymous.enableflag=true
-ftpserver.user.anonymous.writepermission=false
-ftpserver.user.anonymous.maxloginnumber=20
-ftpserver.user.anonymous.maxloginperip=2
-ftpserver.user.anonymous.idletime=300
-ftpserver.user.anonymous.uploadrate=4800
-ftpserver.user.anonymous.downloadrate=4800
+# 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.
+
+# Password is "admin"
+ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3
+ftpserver.user.admin.homedirectory=/tmp
+ftpserver.user.admin.enableflag=true
+ftpserver.user.admin.writepermission=true
+ftpserver.user.admin.maxloginnumber=0
+ftpserver.user.admin.maxloginperip=0
+ftpserver.user.admin.idletime=0
+ftpserver.user.admin.uploadrate=0
+ftpserver.user.admin.downloadrate=0
+
+ftpserver.user.anonymous.userpassword=
+ftpserver.user.anonymous.homedirectory=/tmp
+ftpserver.user.anonymous.enableflag=true
+ftpserver.user.anonymous.writepermission=false
+ftpserver.user.anonymous.maxloginnumber=20
+ftpserver.user.anonymous.maxloginperip=2
+ftpserver.user.anonymous.idletime=300
+ftpserver.user.anonymous.uploadrate=4800
+ftpserver.user.anonymous.downloadrate=4800

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/60937771/examples/ftpserver-osgi-spring-service/src/main/resources/org/apache/ftpserver/example/osgiservice/users.properties
----------------------------------------------------------------------
diff --git a/examples/ftpserver-osgi-spring-service/src/main/resources/org/apache/ftpserver/example/osgiservice/users.properties b/examples/ftpserver-osgi-spring-service/src/main/resources/org/apache/ftpserver/example/osgiservice/users.properties
index 2aed0d1..52899ce 100644
--- a/examples/ftpserver-osgi-spring-service/src/main/resources/org/apache/ftpserver/example/osgiservice/users.properties
+++ b/examples/ftpserver-osgi-spring-service/src/main/resources/org/apache/ftpserver/example/osgiservice/users.properties
@@ -1,37 +1,37 @@
-# 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.
-
-# Password is "admin"
-ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3
-ftpserver.user.admin.homedirectory=/tmp
-ftpserver.user.admin.enableflag=true
-ftpserver.user.admin.writepermission=true
-ftpserver.user.admin.maxloginnumber=0
-ftpserver.user.admin.maxloginperip=0
-ftpserver.user.admin.idletime=0
-ftpserver.user.admin.uploadrate=0
-ftpserver.user.admin.downloadrate=0
-
-ftpserver.user.anonymous.userpassword=
-ftpserver.user.anonymous.homedirectory=/tmp
-ftpserver.user.anonymous.enableflag=true
-ftpserver.user.anonymous.writepermission=false
-ftpserver.user.anonymous.maxloginnumber=20
-ftpserver.user.anonymous.maxloginperip=2
-ftpserver.user.anonymous.idletime=300
-ftpserver.user.anonymous.uploadrate=4800
-ftpserver.user.anonymous.downloadrate=4800
+# 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.
+
+# Password is "admin"
+ftpserver.user.admin.userpassword=21232F297A57A5A743894A0E4A801FC3
+ftpserver.user.admin.homedirectory=/tmp
+ftpserver.user.admin.enableflag=true
+ftpserver.user.admin.writepermission=true
+ftpserver.user.admin.maxloginnumber=0
+ftpserver.user.admin.maxloginperip=0
+ftpserver.user.admin.idletime=0
+ftpserver.user.admin.uploadrate=0
+ftpserver.user.admin.downloadrate=0
+
+ftpserver.user.anonymous.userpassword=
+ftpserver.user.anonymous.homedirectory=/tmp
+ftpserver.user.anonymous.enableflag=true
+ftpserver.user.anonymous.writepermission=false
+ftpserver.user.anonymous.maxloginnumber=20
+ftpserver.user.anonymous.maxloginperip=2
+ftpserver.user.anonymous.idletime=300
+ftpserver.user.anonymous.uploadrate=4800
+ftpserver.user.anonymous.downloadrate=4800


[22/50] [abbrv] git commit: Fix eol-style

Posted by ng...@apache.org.
Fix eol-style

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129826 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/bda3f6b0
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/bda3f6b0
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/bda3f6b0

Branch: refs/heads/trunk
Commit: bda3f6b09f94615d3d57f7a3c385dc3ecdbc6d22
Parents: 61e2d0f
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 17:49:01 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 17:49:01 2011 +0000

----------------------------------------------------------------------
 .../ftpserver/impl/FtpReplyTranslator.java      | 1008 +++++++++---------
 .../apache/ftpserver/ipfilter/IpFilterType.java |  116 +-
 .../ftpserver/ipfilter/SessionFilter.java       |   86 +-
 .../ftpserver/listener/ListenerFactory.java     |  604 +++++------
 core/src/test/resources/users.properties        |  114 +-
 5 files changed, 964 insertions(+), 964 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/bda3f6b0/core/src/main/java/org/apache/ftpserver/impl/FtpReplyTranslator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/FtpReplyTranslator.java b/core/src/main/java/org/apache/ftpserver/impl/FtpReplyTranslator.java
index 156330c..15a74e2 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/FtpReplyTranslator.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/FtpReplyTranslator.java
@@ -1,504 +1,504 @@
-/*
- * 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.ftpserver.impl;
-
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-
-import org.apache.ftpserver.ftplet.FileSystemView;
-import org.apache.ftpserver.ftplet.FtpRequest;
-import org.apache.ftpserver.ftplet.FtpStatistics;
-import org.apache.ftpserver.message.MessageResource;
-import org.apache.ftpserver.util.DateUtils;
-
-/**
- * A utility class for returning translated messages. The utility method,
- * <code>translateMessage</code> also expands any variables in the message.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public class FtpReplyTranslator {
-
-	public static final String CLIENT_ACCESS_TIME = "client.access.time";
-
-	public static final String CLIENT_CON_TIME = "client.con.time";
-
-	public static final String CLIENT_DIR = "client.dir";
-
-	public static final String CLIENT_HOME = "client.home";
-
-	public static final String CLIENT_IP = "client.ip";
-
-	public static final String CLIENT_LOGIN_NAME = "client.login.name";
-
-	public static final String CLIENT_LOGIN_TIME = "client.login.time";
-
-	public static final String OUTPUT_CODE = "output.code";
-
-	public static final String OUTPUT_MSG = "output.msg";
-
-	public static final String REQUEST_ARG = "request.arg";
-
-	public static final String REQUEST_CMD = "request.cmd";
-
-	public static final String REQUEST_LINE = "request.line";
-
-	// /////////////////////// All Server Vatiables /////////////////////////
-	public static final String SERVER_IP = "server.ip";
-
-	public static final String SERVER_PORT = "server.port";
-
-	public static final String STAT_CON_CURR = "stat.con.curr";
-
-	public static final String STAT_CON_TOTAL = "stat.con.total";
-
-	public static final String STAT_DIR_CREATE_COUNT = "stat.dir.create.count";
-
-	public static final String STAT_DIR_DELETE_COUNT = "stat.dir.delete.count";
-
-	public static final String STAT_FILE_DELETE_COUNT = "stat.file.delete.count";
-
-	public static final String STAT_FILE_DOWNLOAD_BYTES = "stat.file.download.bytes";
-
-	public static final String STAT_FILE_DOWNLOAD_COUNT = "stat.file.download.count";
-
-	public static final String STAT_FILE_UPLOAD_BYTES = "stat.file.upload.bytes";
-
-	public static final String STAT_FILE_UPLOAD_COUNT = "stat.file.upload.count";
-
-	public static final String STAT_LOGIN_ANON_CURR = "stat.login.anon.curr";
-
-	public static final String STAT_LOGIN_ANON_TOTAL = "stat.login.anon.total";
-
-	public static final String STAT_LOGIN_CURR = "stat.login.curr";
-
-	public static final String STAT_LOGIN_TOTAL = "stat.login.total";
-
-	public static final String STAT_START_TIME = "stat.start.time";
-
-	/**
-	 * Returns the translated message.
-	 * 
-	 * @param session
-	 *            the FTP session for which a reply is to be sent
-	 * @param request
-	 *            the FTP request object
-	 * @param context
-	 *            the FTP server context
-	 * @param code
-	 *            the reply code
-	 * @param subId
-	 *            the ID of the sub message
-	 * @param basicMsg
-	 *            the basic message
-	 * @return the translated message
-	 */
-	public static String translateMessage(FtpIoSession session,
-		FtpRequest request, FtpServerContext context, int code, String subId,
-		String basicMsg) {
-		MessageResource resource = context.getMessageResource();
-		String lang = session.getLanguage();
-
-		String msg = null;
-		if (resource != null) {
-			msg = resource.getMessage(code, subId, lang);
-		}
-		if (msg == null) {
-			msg = "";
-		}
-		msg = replaceVariables(session, request, context, code, basicMsg, msg);
-
-		return msg;
-	}
-
-	/**
-	 * Replace server variables.
-	 */
-	private static String replaceVariables(FtpIoSession session,
-		FtpRequest request, FtpServerContext context, int code,
-		String basicMsg, String str) {
-
-		int startIndex = 0;
-		int openIndex = str.indexOf('{', startIndex);
-		if (openIndex == -1) {
-			return str;
-		}
-
-		int closeIndex = str.indexOf('}', startIndex);
-		if ((closeIndex == -1) || (openIndex > closeIndex)) {
-			return str;
-		}
-
-		StringBuilder sb = new StringBuilder(128);
-		sb.append(str.substring(startIndex, openIndex));
-		while (true) {
-			String varName = str.substring(openIndex + 1, closeIndex);
-			sb.append(getVariableValue(session, request, context, code,
-				basicMsg, varName));
-
-			startIndex = closeIndex + 1;
-			openIndex = str.indexOf('{', startIndex);
-			if (openIndex == -1) {
-				sb.append(str.substring(startIndex));
-				break;
-			}
-
-			closeIndex = str.indexOf('}', startIndex);
-			if ((closeIndex == -1) || (openIndex > closeIndex)) {
-				sb.append(str.substring(startIndex));
-				break;
-			}
-			sb.append(str.substring(startIndex, openIndex));
-		}
-		return sb.toString();
-	}
-
-	/**
-	 * Get the variable value.
-	 */
-	private static String getVariableValue(FtpIoSession session,
-		FtpRequest request, FtpServerContext context, int code,
-		String basicMsg, String varName) {
-
-		String varVal = null;
-
-		// all output variables
-		if (varName.startsWith("output.")) {
-			varVal = getOutputVariableValue(session, code, basicMsg, varName);
-		}
-
-		// all server variables
-		else if (varName.startsWith("server.")) {
-			varVal = getServerVariableValue(session, varName);
-		}
-
-		// all request variables
-		else if (varName.startsWith("request.")) {
-			varVal = getRequestVariableValue(session, request, varName);
-		}
-
-		// all statistical variables
-		else if (varName.startsWith("stat.")) {
-			varVal = getStatisticalVariableValue(session, context, varName);
-		}
-
-		// all client variables
-		else if (varName.startsWith("client.")) {
-			varVal = getClientVariableValue(session, varName);
-		}
-
-		if (varVal == null) {
-			varVal = "";
-		}
-		return varVal;
-	}
-
-	/**
-	 * Get client variable value.
-	 */
-	private static String getClientVariableValue(FtpIoSession session,
-		String varName) {
-
-		String varVal = null;
-
-		// client ip
-		if (varName.equals(CLIENT_IP)) {
-			if (session.getRemoteAddress() instanceof InetSocketAddress) {
-				InetSocketAddress remoteSocketAddress = (InetSocketAddress) session.getRemoteAddress();
-				varVal = remoteSocketAddress.getAddress().getHostAddress();
-			}
-
-		}
-
-		// client connection time
-		else if (varName.equals(CLIENT_CON_TIME)) {
-			varVal = DateUtils.getISO8601Date(session.getCreationTime());
-		}
-
-		// client login name
-		else if (varName.equals(CLIENT_LOGIN_NAME)) {
-			if (session.getUser() != null) {
-				varVal = session.getUser().getName();
-			}
-		}
-
-		// client login time
-		else if (varName.equals(CLIENT_LOGIN_TIME)) {
-			varVal = DateUtils.getISO8601Date(session.getLoginTime().getTime());
-		}
-
-		// client last access time
-		else if (varName.equals(CLIENT_ACCESS_TIME)) {
-			varVal = DateUtils.getISO8601Date(session.getLastAccessTime().getTime());
-		}
-
-		// client home
-		else if (varName.equals(CLIENT_HOME)) {
-			varVal = session.getUser().getHomeDirectory();
-		}
-
-		// client directory
-		else if (varName.equals(CLIENT_DIR)) {
-			FileSystemView fsView = session.getFileSystemView();
-			if (fsView != null) {
-				try {
-					varVal = fsView.getWorkingDirectory().getAbsolutePath();
-				}
-				catch (Exception ex) {
-					varVal = "";
-				}
-			}
-		}
-		return varVal;
-	}
-
-	/**
-	 * Get output variable value.
-	 */
-	private static String getOutputVariableValue(FtpIoSession session,
-		int code, String basicMsg, String varName) {
-		String varVal = null;
-
-		// output code
-		if (varName.equals(OUTPUT_CODE)) {
-			varVal = String.valueOf(code);
-		}
-
-		// output message
-		else if (varName.equals(OUTPUT_MSG)) {
-			varVal = basicMsg;
-		}
-
-		return varVal;
-	}
-
-	/**
-	 * Get request variable value.
-	 */
-	private static String getRequestVariableValue(FtpIoSession session,
-		FtpRequest request, String varName) {
-
-		String varVal = null;
-
-		if (request == null) {
-			return "";
-		}
-
-		// request line
-		if (varName.equals(REQUEST_LINE)) {
-			varVal = request.getRequestLine();
-		}
-
-		// request command
-		else if (varName.equals(REQUEST_CMD)) {
-			varVal = request.getCommand();
-		}
-
-		// request argument
-		else if (varName.equals(REQUEST_ARG)) {
-			varVal = request.getArgument();
-		}
-
-		return varVal;
-	}
-
-	/**
-	 * Get server variable value.
-	 */
-	private static String getServerVariableValue(FtpIoSession session,
-		String varName) {
-
-		String varVal = null;
-
-		SocketAddress localSocketAddress = session.getLocalAddress();
-
-		if (localSocketAddress instanceof InetSocketAddress) {
-			InetSocketAddress localInetSocketAddress = (InetSocketAddress) localSocketAddress;
-			// server address
-			if (varName.equals(SERVER_IP)) {
-
-				InetAddress addr = localInetSocketAddress.getAddress();
-
-				if (addr != null) {
-					varVal = addr.getHostAddress();
-				}
-			}
-
-			// server port
-			else if (varName.equals(SERVER_PORT)) {
-				varVal = String.valueOf(localInetSocketAddress.getPort());
-			}
-		}
-
-		return varVal;
-	}
-
-	/**
-	 * Get statistical connection variable value.
-	 */
-	private static String getStatisticalConnectionVariableValue(
-		FtpIoSession session, FtpServerContext context, String varName) {
-		String varVal = null;
-		FtpStatistics stat = context.getFtpStatistics();
-
-		// total connection number
-		if (varName.equals(STAT_CON_TOTAL)) {
-			varVal = String.valueOf(stat.getTotalConnectionNumber());
-		}
-
-		// current connection number
-		else if (varName.equals(STAT_CON_CURR)) {
-			varVal = String.valueOf(stat.getCurrentConnectionNumber());
-		}
-
-		return varVal;
-	}
-
-	/**
-	 * Get statistical directory variable value.
-	 */
-	private static String getStatisticalDirectoryVariableValue(
-		FtpIoSession session, FtpServerContext context, String varName) {
-		String varVal = null;
-		FtpStatistics stat = context.getFtpStatistics();
-
-		// total directory created
-		if (varName.equals(STAT_DIR_CREATE_COUNT)) {
-			varVal = String.valueOf(stat.getTotalDirectoryCreated());
-		}
-
-		// total directory removed
-		else if (varName.equals(STAT_DIR_DELETE_COUNT)) {
-			varVal = String.valueOf(stat.getTotalDirectoryRemoved());
-		}
-
-		return varVal;
-	}
-
-	/**
-	 * Get statistical file variable value.
-	 */
-	private static String getStatisticalFileVariableValue(FtpIoSession session,
-		FtpServerContext context, String varName) {
-		String varVal = null;
-		FtpStatistics stat = context.getFtpStatistics();
-
-		// total number of file upload
-		if (varName.equals(STAT_FILE_UPLOAD_COUNT)) {
-			varVal = String.valueOf(stat.getTotalUploadNumber());
-		}
-
-		// total bytes uploaded
-		else if (varName.equals(STAT_FILE_UPLOAD_BYTES)) {
-			varVal = String.valueOf(stat.getTotalUploadSize());
-		}
-
-		// total number of file download
-		else if (varName.equals(STAT_FILE_DOWNLOAD_COUNT)) {
-			varVal = String.valueOf(stat.getTotalDownloadNumber());
-		}
-
-		// total bytes downloaded
-		else if (varName.equals(STAT_FILE_DOWNLOAD_BYTES)) {
-			varVal = String.valueOf(stat.getTotalDownloadSize());
-		}
-
-		// total number of files deleted
-		else if (varName.equals(STAT_FILE_DELETE_COUNT)) {
-			varVal = String.valueOf(stat.getTotalDeleteNumber());
-		}
-
-		return varVal;
-	}
-
-	/**
-	 * Get statistical login variable value.
-	 */
-	private static String getStatisticalLoginVariableValue(
-		FtpIoSession session, FtpServerContext context, String varName) {
-		String varVal = null;
-		FtpStatistics stat = context.getFtpStatistics();
-
-		// total login number
-		if (varName.equals(STAT_LOGIN_TOTAL)) {
-			varVal = String.valueOf(stat.getTotalLoginNumber());
-		}
-
-		// current login number
-		else if (varName.equals(STAT_LOGIN_CURR)) {
-			varVal = String.valueOf(stat.getCurrentLoginNumber());
-		}
-
-		// total anonymous login number
-		else if (varName.equals(STAT_LOGIN_ANON_TOTAL)) {
-			varVal = String.valueOf(stat.getTotalAnonymousLoginNumber());
-		}
-
-		// current anonymous login number
-		else if (varName.equals(STAT_LOGIN_ANON_CURR)) {
-			varVal = String.valueOf(stat.getCurrentAnonymousLoginNumber());
-		}
-
-		return varVal;
-	}
-
-	/**
-	 * Get statistical variable value.
-	 */
-	private static String getStatisticalVariableValue(FtpIoSession session,
-		FtpServerContext context, String varName) {
-
-		String varVal = null;
-		FtpStatistics stat = context.getFtpStatistics();
-
-		// server start time
-		if (varName.equals(STAT_START_TIME)) {
-			varVal = DateUtils.getISO8601Date(stat.getStartTime().getTime());
-		}
-
-		// connection statistical variables
-		else if (varName.startsWith("stat.con")) {
-			varVal = getStatisticalConnectionVariableValue(session, context,
-				varName);
-		}
-
-		// login statistical variables
-		else if (varName.startsWith("stat.login.")) {
-			varVal = getStatisticalLoginVariableValue(session, context, varName);
-		}
-
-		// file statistical variable
-		else if (varName.startsWith("stat.file")) {
-			varVal = getStatisticalFileVariableValue(session, context, varName);
-		}
-
-		// directory statistical variable
-		else if (varName.startsWith("stat.dir.")) {
-			varVal = getStatisticalDirectoryVariableValue(session, context,
-				varName);
-		}
-
-		return varVal;
-	}
-
-}
+/*
+ * 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.ftpserver.impl;
+
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+
+import org.apache.ftpserver.ftplet.FileSystemView;
+import org.apache.ftpserver.ftplet.FtpRequest;
+import org.apache.ftpserver.ftplet.FtpStatistics;
+import org.apache.ftpserver.message.MessageResource;
+import org.apache.ftpserver.util.DateUtils;
+
+/**
+ * A utility class for returning translated messages. The utility method,
+ * <code>translateMessage</code> also expands any variables in the message.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public class FtpReplyTranslator {
+
+	public static final String CLIENT_ACCESS_TIME = "client.access.time";
+
+	public static final String CLIENT_CON_TIME = "client.con.time";
+
+	public static final String CLIENT_DIR = "client.dir";
+
+	public static final String CLIENT_HOME = "client.home";
+
+	public static final String CLIENT_IP = "client.ip";
+
+	public static final String CLIENT_LOGIN_NAME = "client.login.name";
+
+	public static final String CLIENT_LOGIN_TIME = "client.login.time";
+
+	public static final String OUTPUT_CODE = "output.code";
+
+	public static final String OUTPUT_MSG = "output.msg";
+
+	public static final String REQUEST_ARG = "request.arg";
+
+	public static final String REQUEST_CMD = "request.cmd";
+
+	public static final String REQUEST_LINE = "request.line";
+
+	// /////////////////////// All Server Vatiables /////////////////////////
+	public static final String SERVER_IP = "server.ip";
+
+	public static final String SERVER_PORT = "server.port";
+
+	public static final String STAT_CON_CURR = "stat.con.curr";
+
+	public static final String STAT_CON_TOTAL = "stat.con.total";
+
+	public static final String STAT_DIR_CREATE_COUNT = "stat.dir.create.count";
+
+	public static final String STAT_DIR_DELETE_COUNT = "stat.dir.delete.count";
+
+	public static final String STAT_FILE_DELETE_COUNT = "stat.file.delete.count";
+
+	public static final String STAT_FILE_DOWNLOAD_BYTES = "stat.file.download.bytes";
+
+	public static final String STAT_FILE_DOWNLOAD_COUNT = "stat.file.download.count";
+
+	public static final String STAT_FILE_UPLOAD_BYTES = "stat.file.upload.bytes";
+
+	public static final String STAT_FILE_UPLOAD_COUNT = "stat.file.upload.count";
+
+	public static final String STAT_LOGIN_ANON_CURR = "stat.login.anon.curr";
+
+	public static final String STAT_LOGIN_ANON_TOTAL = "stat.login.anon.total";
+
+	public static final String STAT_LOGIN_CURR = "stat.login.curr";
+
+	public static final String STAT_LOGIN_TOTAL = "stat.login.total";
+
+	public static final String STAT_START_TIME = "stat.start.time";
+
+	/**
+	 * Returns the translated message.
+	 * 
+	 * @param session
+	 *            the FTP session for which a reply is to be sent
+	 * @param request
+	 *            the FTP request object
+	 * @param context
+	 *            the FTP server context
+	 * @param code
+	 *            the reply code
+	 * @param subId
+	 *            the ID of the sub message
+	 * @param basicMsg
+	 *            the basic message
+	 * @return the translated message
+	 */
+	public static String translateMessage(FtpIoSession session,
+		FtpRequest request, FtpServerContext context, int code, String subId,
+		String basicMsg) {
+		MessageResource resource = context.getMessageResource();
+		String lang = session.getLanguage();
+
+		String msg = null;
+		if (resource != null) {
+			msg = resource.getMessage(code, subId, lang);
+		}
+		if (msg == null) {
+			msg = "";
+		}
+		msg = replaceVariables(session, request, context, code, basicMsg, msg);
+
+		return msg;
+	}
+
+	/**
+	 * Replace server variables.
+	 */
+	private static String replaceVariables(FtpIoSession session,
+		FtpRequest request, FtpServerContext context, int code,
+		String basicMsg, String str) {
+
+		int startIndex = 0;
+		int openIndex = str.indexOf('{', startIndex);
+		if (openIndex == -1) {
+			return str;
+		}
+
+		int closeIndex = str.indexOf('}', startIndex);
+		if ((closeIndex == -1) || (openIndex > closeIndex)) {
+			return str;
+		}
+
+		StringBuilder sb = new StringBuilder(128);
+		sb.append(str.substring(startIndex, openIndex));
+		while (true) {
+			String varName = str.substring(openIndex + 1, closeIndex);
+			sb.append(getVariableValue(session, request, context, code,
+				basicMsg, varName));
+
+			startIndex = closeIndex + 1;
+			openIndex = str.indexOf('{', startIndex);
+			if (openIndex == -1) {
+				sb.append(str.substring(startIndex));
+				break;
+			}
+
+			closeIndex = str.indexOf('}', startIndex);
+			if ((closeIndex == -1) || (openIndex > closeIndex)) {
+				sb.append(str.substring(startIndex));
+				break;
+			}
+			sb.append(str.substring(startIndex, openIndex));
+		}
+		return sb.toString();
+	}
+
+	/**
+	 * Get the variable value.
+	 */
+	private static String getVariableValue(FtpIoSession session,
+		FtpRequest request, FtpServerContext context, int code,
+		String basicMsg, String varName) {
+
+		String varVal = null;
+
+		// all output variables
+		if (varName.startsWith("output.")) {
+			varVal = getOutputVariableValue(session, code, basicMsg, varName);
+		}
+
+		// all server variables
+		else if (varName.startsWith("server.")) {
+			varVal = getServerVariableValue(session, varName);
+		}
+
+		// all request variables
+		else if (varName.startsWith("request.")) {
+			varVal = getRequestVariableValue(session, request, varName);
+		}
+
+		// all statistical variables
+		else if (varName.startsWith("stat.")) {
+			varVal = getStatisticalVariableValue(session, context, varName);
+		}
+
+		// all client variables
+		else if (varName.startsWith("client.")) {
+			varVal = getClientVariableValue(session, varName);
+		}
+
+		if (varVal == null) {
+			varVal = "";
+		}
+		return varVal;
+	}
+
+	/**
+	 * Get client variable value.
+	 */
+	private static String getClientVariableValue(FtpIoSession session,
+		String varName) {
+
+		String varVal = null;
+
+		// client ip
+		if (varName.equals(CLIENT_IP)) {
+			if (session.getRemoteAddress() instanceof InetSocketAddress) {
+				InetSocketAddress remoteSocketAddress = (InetSocketAddress) session.getRemoteAddress();
+				varVal = remoteSocketAddress.getAddress().getHostAddress();
+			}
+
+		}
+
+		// client connection time
+		else if (varName.equals(CLIENT_CON_TIME)) {
+			varVal = DateUtils.getISO8601Date(session.getCreationTime());
+		}
+
+		// client login name
+		else if (varName.equals(CLIENT_LOGIN_NAME)) {
+			if (session.getUser() != null) {
+				varVal = session.getUser().getName();
+			}
+		}
+
+		// client login time
+		else if (varName.equals(CLIENT_LOGIN_TIME)) {
+			varVal = DateUtils.getISO8601Date(session.getLoginTime().getTime());
+		}
+
+		// client last access time
+		else if (varName.equals(CLIENT_ACCESS_TIME)) {
+			varVal = DateUtils.getISO8601Date(session.getLastAccessTime().getTime());
+		}
+
+		// client home
+		else if (varName.equals(CLIENT_HOME)) {
+			varVal = session.getUser().getHomeDirectory();
+		}
+
+		// client directory
+		else if (varName.equals(CLIENT_DIR)) {
+			FileSystemView fsView = session.getFileSystemView();
+			if (fsView != null) {
+				try {
+					varVal = fsView.getWorkingDirectory().getAbsolutePath();
+				}
+				catch (Exception ex) {
+					varVal = "";
+				}
+			}
+		}
+		return varVal;
+	}
+
+	/**
+	 * Get output variable value.
+	 */
+	private static String getOutputVariableValue(FtpIoSession session,
+		int code, String basicMsg, String varName) {
+		String varVal = null;
+
+		// output code
+		if (varName.equals(OUTPUT_CODE)) {
+			varVal = String.valueOf(code);
+		}
+
+		// output message
+		else if (varName.equals(OUTPUT_MSG)) {
+			varVal = basicMsg;
+		}
+
+		return varVal;
+	}
+
+	/**
+	 * Get request variable value.
+	 */
+	private static String getRequestVariableValue(FtpIoSession session,
+		FtpRequest request, String varName) {
+
+		String varVal = null;
+
+		if (request == null) {
+			return "";
+		}
+
+		// request line
+		if (varName.equals(REQUEST_LINE)) {
+			varVal = request.getRequestLine();
+		}
+
+		// request command
+		else if (varName.equals(REQUEST_CMD)) {
+			varVal = request.getCommand();
+		}
+
+		// request argument
+		else if (varName.equals(REQUEST_ARG)) {
+			varVal = request.getArgument();
+		}
+
+		return varVal;
+	}
+
+	/**
+	 * Get server variable value.
+	 */
+	private static String getServerVariableValue(FtpIoSession session,
+		String varName) {
+
+		String varVal = null;
+
+		SocketAddress localSocketAddress = session.getLocalAddress();
+
+		if (localSocketAddress instanceof InetSocketAddress) {
+			InetSocketAddress localInetSocketAddress = (InetSocketAddress) localSocketAddress;
+			// server address
+			if (varName.equals(SERVER_IP)) {
+
+				InetAddress addr = localInetSocketAddress.getAddress();
+
+				if (addr != null) {
+					varVal = addr.getHostAddress();
+				}
+			}
+
+			// server port
+			else if (varName.equals(SERVER_PORT)) {
+				varVal = String.valueOf(localInetSocketAddress.getPort());
+			}
+		}
+
+		return varVal;
+	}
+
+	/**
+	 * Get statistical connection variable value.
+	 */
+	private static String getStatisticalConnectionVariableValue(
+		FtpIoSession session, FtpServerContext context, String varName) {
+		String varVal = null;
+		FtpStatistics stat = context.getFtpStatistics();
+
+		// total connection number
+		if (varName.equals(STAT_CON_TOTAL)) {
+			varVal = String.valueOf(stat.getTotalConnectionNumber());
+		}
+
+		// current connection number
+		else if (varName.equals(STAT_CON_CURR)) {
+			varVal = String.valueOf(stat.getCurrentConnectionNumber());
+		}
+
+		return varVal;
+	}
+
+	/**
+	 * Get statistical directory variable value.
+	 */
+	private static String getStatisticalDirectoryVariableValue(
+		FtpIoSession session, FtpServerContext context, String varName) {
+		String varVal = null;
+		FtpStatistics stat = context.getFtpStatistics();
+
+		// total directory created
+		if (varName.equals(STAT_DIR_CREATE_COUNT)) {
+			varVal = String.valueOf(stat.getTotalDirectoryCreated());
+		}
+
+		// total directory removed
+		else if (varName.equals(STAT_DIR_DELETE_COUNT)) {
+			varVal = String.valueOf(stat.getTotalDirectoryRemoved());
+		}
+
+		return varVal;
+	}
+
+	/**
+	 * Get statistical file variable value.
+	 */
+	private static String getStatisticalFileVariableValue(FtpIoSession session,
+		FtpServerContext context, String varName) {
+		String varVal = null;
+		FtpStatistics stat = context.getFtpStatistics();
+
+		// total number of file upload
+		if (varName.equals(STAT_FILE_UPLOAD_COUNT)) {
+			varVal = String.valueOf(stat.getTotalUploadNumber());
+		}
+
+		// total bytes uploaded
+		else if (varName.equals(STAT_FILE_UPLOAD_BYTES)) {
+			varVal = String.valueOf(stat.getTotalUploadSize());
+		}
+
+		// total number of file download
+		else if (varName.equals(STAT_FILE_DOWNLOAD_COUNT)) {
+			varVal = String.valueOf(stat.getTotalDownloadNumber());
+		}
+
+		// total bytes downloaded
+		else if (varName.equals(STAT_FILE_DOWNLOAD_BYTES)) {
+			varVal = String.valueOf(stat.getTotalDownloadSize());
+		}
+
+		// total number of files deleted
+		else if (varName.equals(STAT_FILE_DELETE_COUNT)) {
+			varVal = String.valueOf(stat.getTotalDeleteNumber());
+		}
+
+		return varVal;
+	}
+
+	/**
+	 * Get statistical login variable value.
+	 */
+	private static String getStatisticalLoginVariableValue(
+		FtpIoSession session, FtpServerContext context, String varName) {
+		String varVal = null;
+		FtpStatistics stat = context.getFtpStatistics();
+
+		// total login number
+		if (varName.equals(STAT_LOGIN_TOTAL)) {
+			varVal = String.valueOf(stat.getTotalLoginNumber());
+		}
+
+		// current login number
+		else if (varName.equals(STAT_LOGIN_CURR)) {
+			varVal = String.valueOf(stat.getCurrentLoginNumber());
+		}
+
+		// total anonymous login number
+		else if (varName.equals(STAT_LOGIN_ANON_TOTAL)) {
+			varVal = String.valueOf(stat.getTotalAnonymousLoginNumber());
+		}
+
+		// current anonymous login number
+		else if (varName.equals(STAT_LOGIN_ANON_CURR)) {
+			varVal = String.valueOf(stat.getCurrentAnonymousLoginNumber());
+		}
+
+		return varVal;
+	}
+
+	/**
+	 * Get statistical variable value.
+	 */
+	private static String getStatisticalVariableValue(FtpIoSession session,
+		FtpServerContext context, String varName) {
+
+		String varVal = null;
+		FtpStatistics stat = context.getFtpStatistics();
+
+		// server start time
+		if (varName.equals(STAT_START_TIME)) {
+			varVal = DateUtils.getISO8601Date(stat.getStartTime().getTime());
+		}
+
+		// connection statistical variables
+		else if (varName.startsWith("stat.con")) {
+			varVal = getStatisticalConnectionVariableValue(session, context,
+				varName);
+		}
+
+		// login statistical variables
+		else if (varName.startsWith("stat.login.")) {
+			varVal = getStatisticalLoginVariableValue(session, context, varName);
+		}
+
+		// file statistical variable
+		else if (varName.startsWith("stat.file")) {
+			varVal = getStatisticalFileVariableValue(session, context, varName);
+		}
+
+		// directory statistical variable
+		else if (varName.startsWith("stat.dir.")) {
+			varVal = getStatisticalDirectoryVariableValue(session, context,
+				varName);
+		}
+
+		return varVal;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/bda3f6b0/core/src/main/java/org/apache/ftpserver/ipfilter/IpFilterType.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/ipfilter/IpFilterType.java b/core/src/main/java/org/apache/ftpserver/ipfilter/IpFilterType.java
index 9538d2e..569417d 100644
--- a/core/src/main/java/org/apache/ftpserver/ipfilter/IpFilterType.java
+++ b/core/src/main/java/org/apache/ftpserver/ipfilter/IpFilterType.java
@@ -1,58 +1,58 @@
-/*
- * 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.ftpserver.ipfilter;
-
-/**
- * Defines various types of IP Filters.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-public enum IpFilterType {
-
-	/**
-	 * filter type that allows a set of predefined IP addresses, also known as a
-	 * white list.
-	 */
-	ALLOW,
-
-	/**
-	 * filter type that blocks a set of predefined IP addresses, also known as a
-	 * black list.
-	 */
-	DENY;
-
-	/**
-	 * Parses the given string into its equivalent enum.
-	 * 
-	 * @param value
-	 *            the string value to parse.
-	 * @return the equivalent enum
-	 */
-	public static IpFilterType parse(String value) {
-		for (IpFilterType type : values()) {
-			if (type.name().equalsIgnoreCase(value)) {
-				return type;
-			}
-		}
-		throw new IllegalArgumentException("Invalid IpFilterType: " + value);
-	}
-
-}
+/*
+ * 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.ftpserver.ipfilter;
+
+/**
+ * Defines various types of IP Filters.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+public enum IpFilterType {
+
+	/**
+	 * filter type that allows a set of predefined IP addresses, also known as a
+	 * white list.
+	 */
+	ALLOW,
+
+	/**
+	 * filter type that blocks a set of predefined IP addresses, also known as a
+	 * black list.
+	 */
+	DENY;
+
+	/**
+	 * Parses the given string into its equivalent enum.
+	 * 
+	 * @param value
+	 *            the string value to parse.
+	 * @return the equivalent enum
+	 */
+	public static IpFilterType parse(String value) {
+		for (IpFilterType type : values()) {
+			if (type.name().equalsIgnoreCase(value)) {
+				return type;
+			}
+		}
+		throw new IllegalArgumentException("Invalid IpFilterType: " + value);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/bda3f6b0/core/src/main/java/org/apache/ftpserver/ipfilter/SessionFilter.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/ipfilter/SessionFilter.java b/core/src/main/java/org/apache/ftpserver/ipfilter/SessionFilter.java
index ec2b8c5..f85524a 100644
--- a/core/src/main/java/org/apache/ftpserver/ipfilter/SessionFilter.java
+++ b/core/src/main/java/org/apache/ftpserver/ipfilter/SessionFilter.java
@@ -1,43 +1,43 @@
-/*
- * 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.ftpserver.ipfilter;
-
-import org.apache.mina.core.session.IoSession;
-
-/**
- * The interface for filtering sessions based on various session attributes.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public interface SessionFilter {
-
-    /**
-     * Tells whether or not the given session is accepted by this filter.
-     * 
-     * @param session
-     *            the session to check
-     * @return <code>true</code>, if the given session is accepted by this
-     *         filter; <code>false</code>, otherwise.
-     */
-    public boolean accept(IoSession session);
-
-}
+/*
+ * 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.ftpserver.ipfilter;
+
+import org.apache.mina.core.session.IoSession;
+
+/**
+ * The interface for filtering sessions based on various session attributes.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public interface SessionFilter {
+
+    /**
+     * Tells whether or not the given session is accepted by this filter.
+     * 
+     * @param session
+     *            the session to check
+     * @return <code>true</code>, if the given session is accepted by this
+     *         filter; <code>false</code>, otherwise.
+     */
+    public boolean accept(IoSession session);
+
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/bda3f6b0/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java b/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java
index 96168e4..fe9c893 100644
--- a/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java
+++ b/core/src/main/java/org/apache/ftpserver/listener/ListenerFactory.java
@@ -1,303 +1,303 @@
-/*
- * 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.ftpserver.listener;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.List;
-
-import org.apache.ftpserver.DataConnectionConfiguration;
-import org.apache.ftpserver.DataConnectionConfigurationFactory;
-import org.apache.ftpserver.FtpServerConfigurationException;
-import org.apache.ftpserver.ipfilter.SessionFilter;
-import org.apache.ftpserver.listener.nio.NioListener;
-import org.apache.ftpserver.ssl.SslConfiguration;
-import org.apache.mina.filter.firewall.Subnet;
-
-/**
- * Factory for listeners. Listeners themselves are immutable and must be 
- * created using this factory.
- *
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- */
-public class ListenerFactory {
-
-    private String serverAddress;
-
-    private int port = 21;
-
-    private SslConfiguration ssl;
-
-    private boolean implicitSsl = false;
-
-    private DataConnectionConfiguration dataConnectionConfig = new DataConnectionConfigurationFactory()
-            .createDataConnectionConfiguration();
-
-    private int idleTimeout = 300;
-
-    private List<InetAddress> blockedAddresses;
-
-    private List<Subnet> blockedSubnets;
-    
-    /**
-     * The Session filter
-     */
-    private SessionFilter sessionFilter = null;
-
-    /**
-     * Default constructor
-     */
-    public ListenerFactory() {
-        // do nothing
-    }
-
-    /**
-     * Copy constructor, will copy properties from the provided listener.
-     * @param listener The listener which properties will be used for this factory
-     */
-    public ListenerFactory(Listener listener) {
-        serverAddress = listener.getServerAddress();
-        port = listener.getPort();
-        ssl = listener.getSslConfiguration();
-        implicitSsl = listener.isImplicitSsl();
-        dataConnectionConfig = listener.getDataConnectionConfiguration();
-        idleTimeout = listener.getIdleTimeout();
-        // TODO remove the next two lines if and when we remove the deprecated
-        // methods.
-        blockedAddresses = listener.getBlockedAddresses();
-        blockedSubnets = listener.getBlockedSubnets();
-        this.sessionFilter = listener.getSessionFilter();
-    }
-
-    /**
-     * Create a listener based on the settings of this factory. The listener is immutable.
-     * @return The created listener
-     */
-    public Listener createListener() {
-        try {
-            InetAddress.getByName(serverAddress);
-        } catch (UnknownHostException e) {
-            throw new FtpServerConfigurationException("Unknown host", e);
-        }
-        // Deal with the old style black list and new session Filter here.
-        if (sessionFilter != null) {
-            if (blockedAddresses != null || blockedSubnets != null) {
-                throw new IllegalStateException(
-                        "Usage of SessionFilter in combination with blockedAddesses/subnets is not supported. ");
-            }
-        }
-        if (blockedAddresses != null || blockedSubnets != null) {
-            return new NioListener(serverAddress, port, implicitSsl, ssl,
-                    dataConnectionConfig, idleTimeout, blockedAddresses,
-                    blockedSubnets);
-        } else {
-            return new NioListener(serverAddress, port, implicitSsl, ssl,
-                    dataConnectionConfig, idleTimeout, sessionFilter);
-        }
-    }
-
-    /**
-     * Is listeners created by this factory in SSL mode automatically or must the client explicitly
-     * request to use SSL
-     * 
-     * @return true is listeners created by this factory is automatically in SSL mode, false
-     *         otherwise
-     */
-    public boolean isImplicitSsl() {
-        return implicitSsl;
-    }
-
-    /**
-     * Should listeners created by this factory be in SSL mode automatically or must the client
-     * explicitly request to use SSL
-     * 
-     * @param implicitSsl
-     *            true is listeners created by this factory should automatically be in SSL mode,
-     *            false otherwise
-     */
-    public void setImplicitSsl(boolean implicitSsl) {
-        this.implicitSsl = implicitSsl;
-    }
-
-    /**
-     * Get the port on which listeners created by this factory is waiting for requests. 
-     * 
-     * @return The port
-     */
-    public int getPort() {
-        return port;
-    }
-
-    /**
-     * Set the port on which listeners created by this factory will accept requests. Or set to 0
-     * (zero) is the port should be automatically assigned
-     * 
-     * @param port
-     *            The port to use.
-     */
-    public void setPort(int port) {
-        this.port = port;
-    }
-
-    /**
-     * Get the {@link InetAddress} used for binding the local socket. Defaults
-     * to null, that is, the server binds to all available network interfaces
-     * 
-     * @return The local socket {@link InetAddress}, if set
-     */
-    public String getServerAddress()  {
-        return serverAddress;
-    }
-
-    /**
-     * Set the {@link InetAddress} used for binding the local socket. Defaults
-     * to null, that is, the server binds to all available network interfaces
-     * 
-     * @param serverAddress
-     *            The local socket {@link InetAddress}
-     */
-    public void setServerAddress(String serverAddress) {
-        this.serverAddress = serverAddress;
-    }
-
-    /**
-     * Get the {@link SslConfiguration} used for listeners created by this factory
-     * 
-     * @return The {@link SslConfiguration}
-     */
-    public SslConfiguration getSslConfiguration() {
-        return ssl;
-    }
-
-    /**
-     * Set the {@link SslConfiguration} to use by listeners created by this factory
-     * @param ssl The {@link SslConfiguration}
-     */
-    public void setSslConfiguration(SslConfiguration ssl) {
-        this.ssl = ssl;
-    }
-
-    /**
-     * Get configuration for data connections made within listeners created by this factory
-     * 
-     * @return The data connection configuration
-     */
-    public DataConnectionConfiguration getDataConnectionConfiguration() {
-        return dataConnectionConfig;
-    }
-
-    /**
-     * Set configuration for data connections made within listeners created by this factory
-     * 
-     * @param dataConnectionConfig
-     *            The data connection configuration
-     */
-    public void setDataConnectionConfiguration(
-            DataConnectionConfiguration dataConnectionConfig) {
-        this.dataConnectionConfig = dataConnectionConfig;
-    }
-
-    /**
-     * Get the number of seconds during which no network activity 
-     * is allowed before a session is closed due to inactivity.  
-     * @return The idle time out
-     */
-    public int getIdleTimeout() {
-        return idleTimeout;
-    }
-
-    /**
-     * Set the number of seconds during which no network activity 
-     * is allowed before a session is closed due to inactivity.  
-     *
-     * @param idleTimeout The idle timeout in seconds
-     */
-    public void setIdleTimeout(int idleTimeout) {
-        this.idleTimeout = idleTimeout;
-    }
-
-    /**
-     * @deprecated Replaced by the IpFilter.    
-     * Retrieves the {@link InetAddress} for which listeners created by this factory blocks
-     * connections
-     * 
-     * @return The list of {@link InetAddress}es
-     */
-    @Deprecated
-    public List<InetAddress> getBlockedAddresses() {
-        return blockedAddresses;
-    }
-
-    /**
-     * @deprecated Replaced by the IpFilter.    
-     * Sets the {@link InetAddress} that listeners created by this factory will block from
-     * connecting
-     * 
-     * @param blockedAddresses
-     *            The list of {@link InetAddress}es
-     */
-    @Deprecated
-    public void setBlockedAddresses(List<InetAddress> blockedAddresses) {
-        this.blockedAddresses = blockedAddresses;
-    }
-
-    /**
-     * @deprecated Replaced by the IpFilter.    
-     * Retrives the {@link Subnet}s for which listeners created by this factory blocks connections
-     * 
-     * @return The list of {@link Subnet}s
-     */
-    @Deprecated
-    public List<Subnet> getBlockedSubnets() {
-        return blockedSubnets;
-    }
-
-    /**
-     * Sets the {@link Subnet}s that listeners created by this factory will block from connecting
-     * @param blockedSubnets 
-     *  The list of {@link Subnet}s
-     * @deprecated Replaced by the IpFilter.    
-     */
-    @Deprecated
-    public void setBlockedSubnets(List<Subnet> blockedSubnets) {
-        this.blockedSubnets = blockedSubnets;
-    }
-    
-    /**
-     * Returns the currently configured <code>SessionFilter</code>, if any.
-     * 
-     * @return the currently configured <code>SessionFilter</code>, if any.
-     *         Returns <code>null</code>, if no <code>SessionFilter</code> is
-     *         configured.
-     */
-    public SessionFilter getSessionFilter() {
-        return sessionFilter;
-    }
-
-    /**
-     * Sets the session filter to the given filter.
-     * 
-     * @param sessionFilter
-     *            the session filter.
-     */
-    public void setSessionFilter(SessionFilter sessionFilter) {
-        this.sessionFilter = sessionFilter;
-    }
+/*
+ * 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.ftpserver.listener;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.List;
+
+import org.apache.ftpserver.DataConnectionConfiguration;
+import org.apache.ftpserver.DataConnectionConfigurationFactory;
+import org.apache.ftpserver.FtpServerConfigurationException;
+import org.apache.ftpserver.ipfilter.SessionFilter;
+import org.apache.ftpserver.listener.nio.NioListener;
+import org.apache.ftpserver.ssl.SslConfiguration;
+import org.apache.mina.filter.firewall.Subnet;
+
+/**
+ * Factory for listeners. Listeners themselves are immutable and must be 
+ * created using this factory.
+ *
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ */
+public class ListenerFactory {
+
+    private String serverAddress;
+
+    private int port = 21;
+
+    private SslConfiguration ssl;
+
+    private boolean implicitSsl = false;
+
+    private DataConnectionConfiguration dataConnectionConfig = new DataConnectionConfigurationFactory()
+            .createDataConnectionConfiguration();
+
+    private int idleTimeout = 300;
+
+    private List<InetAddress> blockedAddresses;
+
+    private List<Subnet> blockedSubnets;
+    
+    /**
+     * The Session filter
+     */
+    private SessionFilter sessionFilter = null;
+
+    /**
+     * Default constructor
+     */
+    public ListenerFactory() {
+        // do nothing
+    }
+
+    /**
+     * Copy constructor, will copy properties from the provided listener.
+     * @param listener The listener which properties will be used for this factory
+     */
+    public ListenerFactory(Listener listener) {
+        serverAddress = listener.getServerAddress();
+        port = listener.getPort();
+        ssl = listener.getSslConfiguration();
+        implicitSsl = listener.isImplicitSsl();
+        dataConnectionConfig = listener.getDataConnectionConfiguration();
+        idleTimeout = listener.getIdleTimeout();
+        // TODO remove the next two lines if and when we remove the deprecated
+        // methods.
+        blockedAddresses = listener.getBlockedAddresses();
+        blockedSubnets = listener.getBlockedSubnets();
+        this.sessionFilter = listener.getSessionFilter();
+    }
+
+    /**
+     * Create a listener based on the settings of this factory. The listener is immutable.
+     * @return The created listener
+     */
+    public Listener createListener() {
+        try {
+            InetAddress.getByName(serverAddress);
+        } catch (UnknownHostException e) {
+            throw new FtpServerConfigurationException("Unknown host", e);
+        }
+        // Deal with the old style black list and new session Filter here.
+        if (sessionFilter != null) {
+            if (blockedAddresses != null || blockedSubnets != null) {
+                throw new IllegalStateException(
+                        "Usage of SessionFilter in combination with blockedAddesses/subnets is not supported. ");
+            }
+        }
+        if (blockedAddresses != null || blockedSubnets != null) {
+            return new NioListener(serverAddress, port, implicitSsl, ssl,
+                    dataConnectionConfig, idleTimeout, blockedAddresses,
+                    blockedSubnets);
+        } else {
+            return new NioListener(serverAddress, port, implicitSsl, ssl,
+                    dataConnectionConfig, idleTimeout, sessionFilter);
+        }
+    }
+
+    /**
+     * Is listeners created by this factory in SSL mode automatically or must the client explicitly
+     * request to use SSL
+     * 
+     * @return true is listeners created by this factory is automatically in SSL mode, false
+     *         otherwise
+     */
+    public boolean isImplicitSsl() {
+        return implicitSsl;
+    }
+
+    /**
+     * Should listeners created by this factory be in SSL mode automatically or must the client
+     * explicitly request to use SSL
+     * 
+     * @param implicitSsl
+     *            true is listeners created by this factory should automatically be in SSL mode,
+     *            false otherwise
+     */
+    public void setImplicitSsl(boolean implicitSsl) {
+        this.implicitSsl = implicitSsl;
+    }
+
+    /**
+     * Get the port on which listeners created by this factory is waiting for requests. 
+     * 
+     * @return The port
+     */
+    public int getPort() {
+        return port;
+    }
+
+    /**
+     * Set the port on which listeners created by this factory will accept requests. Or set to 0
+     * (zero) is the port should be automatically assigned
+     * 
+     * @param port
+     *            The port to use.
+     */
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    /**
+     * Get the {@link InetAddress} used for binding the local socket. Defaults
+     * to null, that is, the server binds to all available network interfaces
+     * 
+     * @return The local socket {@link InetAddress}, if set
+     */
+    public String getServerAddress()  {
+        return serverAddress;
+    }
+
+    /**
+     * Set the {@link InetAddress} used for binding the local socket. Defaults
+     * to null, that is, the server binds to all available network interfaces
+     * 
+     * @param serverAddress
+     *            The local socket {@link InetAddress}
+     */
+    public void setServerAddress(String serverAddress) {
+        this.serverAddress = serverAddress;
+    }
+
+    /**
+     * Get the {@link SslConfiguration} used for listeners created by this factory
+     * 
+     * @return The {@link SslConfiguration}
+     */
+    public SslConfiguration getSslConfiguration() {
+        return ssl;
+    }
+
+    /**
+     * Set the {@link SslConfiguration} to use by listeners created by this factory
+     * @param ssl The {@link SslConfiguration}
+     */
+    public void setSslConfiguration(SslConfiguration ssl) {
+        this.ssl = ssl;
+    }
+
+    /**
+     * Get configuration for data connections made within listeners created by this factory
+     * 
+     * @return The data connection configuration
+     */
+    public DataConnectionConfiguration getDataConnectionConfiguration() {
+        return dataConnectionConfig;
+    }
+
+    /**
+     * Set configuration for data connections made within listeners created by this factory
+     * 
+     * @param dataConnectionConfig
+     *            The data connection configuration
+     */
+    public void setDataConnectionConfiguration(
+            DataConnectionConfiguration dataConnectionConfig) {
+        this.dataConnectionConfig = dataConnectionConfig;
+    }
+
+    /**
+     * Get the number of seconds during which no network activity 
+     * is allowed before a session is closed due to inactivity.  
+     * @return The idle time out
+     */
+    public int getIdleTimeout() {
+        return idleTimeout;
+    }
+
+    /**
+     * Set the number of seconds during which no network activity 
+     * is allowed before a session is closed due to inactivity.  
+     *
+     * @param idleTimeout The idle timeout in seconds
+     */
+    public void setIdleTimeout(int idleTimeout) {
+        this.idleTimeout = idleTimeout;
+    }
+
+    /**
+     * @deprecated Replaced by the IpFilter.    
+     * Retrieves the {@link InetAddress} for which listeners created by this factory blocks
+     * connections
+     * 
+     * @return The list of {@link InetAddress}es
+     */
+    @Deprecated
+    public List<InetAddress> getBlockedAddresses() {
+        return blockedAddresses;
+    }
+
+    /**
+     * @deprecated Replaced by the IpFilter.    
+     * Sets the {@link InetAddress} that listeners created by this factory will block from
+     * connecting
+     * 
+     * @param blockedAddresses
+     *            The list of {@link InetAddress}es
+     */
+    @Deprecated
+    public void setBlockedAddresses(List<InetAddress> blockedAddresses) {
+        this.blockedAddresses = blockedAddresses;
+    }
+
+    /**
+     * @deprecated Replaced by the IpFilter.    
+     * Retrives the {@link Subnet}s for which listeners created by this factory blocks connections
+     * 
+     * @return The list of {@link Subnet}s
+     */
+    @Deprecated
+    public List<Subnet> getBlockedSubnets() {
+        return blockedSubnets;
+    }
+
+    /**
+     * Sets the {@link Subnet}s that listeners created by this factory will block from connecting
+     * @param blockedSubnets 
+     *  The list of {@link Subnet}s
+     * @deprecated Replaced by the IpFilter.    
+     */
+    @Deprecated
+    public void setBlockedSubnets(List<Subnet> blockedSubnets) {
+        this.blockedSubnets = blockedSubnets;
+    }
+    
+    /**
+     * Returns the currently configured <code>SessionFilter</code>, if any.
+     * 
+     * @return the currently configured <code>SessionFilter</code>, if any.
+     *         Returns <code>null</code>, if no <code>SessionFilter</code> is
+     *         configured.
+     */
+    public SessionFilter getSessionFilter() {
+        return sessionFilter;
+    }
+
+    /**
+     * Sets the session filter to the given filter.
+     * 
+     * @param sessionFilter
+     *            the session filter.
+     */
+    public void setSessionFilter(SessionFilter sessionFilter) {
+        this.sessionFilter = sessionFilter;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/bda3f6b0/core/src/test/resources/users.properties
----------------------------------------------------------------------
diff --git a/core/src/test/resources/users.properties b/core/src/test/resources/users.properties
index 30127a8..348eef8 100644
--- a/core/src/test/resources/users.properties
+++ b/core/src/test/resources/users.properties
@@ -1,57 +1,57 @@
-# 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.
-
-#Generated file - don't edit (please)
-#Wed Feb 07 20:58:22 CET 2007
-
-ftpserver.user.admin.userpassword=admin
-ftpserver.user.admin.homedirectory=./test-tmp/ftproot
-ftpserver.user.admin.maxloginperip=0
-ftpserver.user.admin.idletime=0
-ftpserver.user.admin.enableflag=true
-ftpserver.user.admin.writepermission=true
-ftpserver.user.admin.maxloginnumber=0
-ftpserver.user.admin.uploadrate=0
-ftpserver.user.admin.downloadrate=0
-
-ftpserver.user.testuser1.homedirectory=./test-tmp/ftproot
-ftpserver.user.testuser1.maxloginnumber=3
-ftpserver.user.testuser1.writepermission=true
-ftpserver.user.testuser1.userpassword=password
-
-ftpserver.user.testuser2.userpassword=password
-ftpserver.user.testuser2.writepermission=true
-ftpserver.user.testuser2.homedirectory=./test-tmp/ftproot
-ftpserver.user.testuser2.maxloginperip=2
-
-ftpserver.user.testuser3.userpassword=
-ftpserver.user.testuser3.writepermission=true
-ftpserver.user.testuser3.homedirectory=./test-tmp/ftproot
-
-ftpserver.user.testuser4.userpassword=password
-ftpserver.user.testuser4.enableflag=false
-ftpserver.user.testuser4.homedirectory=./test-tmp/ftproot
-
-ftpserver.user.anonymous.userpassword=
-ftpserver.user.anonymous.maxloginperip=2
-ftpserver.user.anonymous.uploadrate=4800
-ftpserver.user.anonymous.writepermission=false
-ftpserver.user.anonymous.maxloginnumber=20
-ftpserver.user.anonymous.enableflag=true
-ftpserver.user.anonymous.homedirectory=./test-tmp/ftproot
-ftpserver.user.anonymous.idletime=300
-ftpserver.user.anonymous.downloadrate=4800
+# 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.
+
+#Generated file - don't edit (please)
+#Wed Feb 07 20:58:22 CET 2007
+
+ftpserver.user.admin.userpassword=admin
+ftpserver.user.admin.homedirectory=./test-tmp/ftproot
+ftpserver.user.admin.maxloginperip=0
+ftpserver.user.admin.idletime=0
+ftpserver.user.admin.enableflag=true
+ftpserver.user.admin.writepermission=true
+ftpserver.user.admin.maxloginnumber=0
+ftpserver.user.admin.uploadrate=0
+ftpserver.user.admin.downloadrate=0
+
+ftpserver.user.testuser1.homedirectory=./test-tmp/ftproot
+ftpserver.user.testuser1.maxloginnumber=3
+ftpserver.user.testuser1.writepermission=true
+ftpserver.user.testuser1.userpassword=password
+
+ftpserver.user.testuser2.userpassword=password
+ftpserver.user.testuser2.writepermission=true
+ftpserver.user.testuser2.homedirectory=./test-tmp/ftproot
+ftpserver.user.testuser2.maxloginperip=2
+
+ftpserver.user.testuser3.userpassword=
+ftpserver.user.testuser3.writepermission=true
+ftpserver.user.testuser3.homedirectory=./test-tmp/ftproot
+
+ftpserver.user.testuser4.userpassword=password
+ftpserver.user.testuser4.enableflag=false
+ftpserver.user.testuser4.homedirectory=./test-tmp/ftproot
+
+ftpserver.user.anonymous.userpassword=
+ftpserver.user.anonymous.maxloginperip=2
+ftpserver.user.anonymous.uploadrate=4800
+ftpserver.user.anonymous.writepermission=false
+ftpserver.user.anonymous.maxloginnumber=20
+ftpserver.user.anonymous.enableflag=true
+ftpserver.user.anonymous.homedirectory=./test-tmp/ftproot
+ftpserver.user.anonymous.idletime=300
+ftpserver.user.anonymous.downloadrate=4800


[08/50] [abbrv] git commit: Document throws to prevent warnings (cannot remove throws because subclass needs to throw)

Posted by ng...@apache.org.
Document throws to prevent warnings (cannot remove throws because subclass needs to throw)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129742 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/5987bc53
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/5987bc53
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/5987bc53

Branch: refs/heads/trunk
Commit: 5987bc539f37c8d4c4290cb3f349c90186d272d6
Parents: 372c4ef
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:11:03 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:11:03 2011 +0000

----------------------------------------------------------------------
 .../ftpserver/ftpletcontainer/FtpLetReturnDisconnectTest.java    | 4 ++++
 .../apache/ftpserver/ftpletcontainer/FtpLetReturnSkipTest.java   | 4 ++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5987bc53/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDisconnectTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDisconnectTest.java b/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDisconnectTest.java
index 09caad7..50e09b8 100644
--- a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDisconnectTest.java
+++ b/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDisconnectTest.java
@@ -529,6 +529,10 @@ public class FtpLetReturnDisconnectTest extends ClientTestTemplate {
         TestUtil.assertFileEqual(TESTDATA, ROOT_DIR.listFiles()[0]);
     }
 
+    /**
+     * @throws FtpException  
+     * @throws IOException 
+     */
     protected void throwException() throws FtpException, IOException {
         // do not throw, we want to check the result of return values
     }

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5987bc53/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnSkipTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnSkipTest.java b/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnSkipTest.java
index 4e59719..de3a3ca 100644
--- a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnSkipTest.java
+++ b/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnSkipTest.java
@@ -432,6 +432,10 @@ public class FtpLetReturnSkipTest extends ClientTestTemplate {
         TestUtil.assertFileEqual(TESTDATA, ROOT_DIR.listFiles()[0]);
     }
 
+    /**
+     * @throws FtpException 
+     * @throws IOException  
+     */
     protected void throwException() throws FtpException, IOException {
         // do not throw, we want to check the result of return values
     }


[45/50] [abbrv] git commit: Upgrading slf4j

Posted by ng...@apache.org.
Upgrading slf4j

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1196490 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/18c64247
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/18c64247
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/18c64247

Branch: refs/heads/trunk
Commit: 18c6424785d68bc8f7d89479d4324e9ec2a1d5cf
Parents: 943dc8e
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Wed Nov 2 08:17:32 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Wed Nov 2 08:17:32 2011 +0000

----------------------------------------------------------------------
 pom.xml | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/18c64247/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 61260b7..75a8e7a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,15 +7,15 @@
  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. -->  
+ under the License. -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -173,13 +173,13 @@
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
-        <version>1.5.2</version>
+        <version>1.6.4</version>
       </dependency>
 
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>jcl-over-slf4j</artifactId>
-        <version>1.5.2</version>
+        <version>1.6.4</version>
       </dependency>
 
       <!-- Test dependencies -->
@@ -188,7 +188,7 @@
         <artifactId>junit</artifactId>
         <version>4.8.2</version>
       </dependency>
- 
+
       <dependency>
         <groupId>commons-net</groupId>
         <artifactId>commons-net</artifactId>
@@ -198,9 +198,9 @@
       <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-log4j12</artifactId>
-        <version>1.5.2</version>
+        <version>1.6.4</version>
       </dependency>
-    
+
       <dependency>
         <groupId>log4j</groupId>
         <artifactId>log4j</artifactId>
@@ -331,7 +331,7 @@
           </archive>
         </configuration>
       </plugin>
-      
+
       <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-war-plugin</artifactId>


[13/50] [abbrv] git commit: Unused imports

Posted by ng...@apache.org.
Unused imports

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129751 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/03ef8ada
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/03ef8ada
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/03ef8ada

Branch: refs/heads/trunk
Commit: 03ef8ada1c0d63dea7090c13bc8a598880aec68b
Parents: 860514e
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:15:36 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:15:36 2011 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/ftpserver/listener/nio/NioListener.java    | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/03ef8ada/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java b/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
index 8a4c708..401b7d3 100644
--- a/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
+++ b/core/src/main/java/org/apache/ftpserver/listener/nio/NioListener.java
@@ -48,7 +48,6 @@ import org.apache.mina.filter.firewall.Subnet;
 import org.apache.mina.filter.logging.MdcInjectionFilter;
 import org.apache.mina.filter.ssl.SslFilter;
 import org.apache.mina.transport.socket.SocketAcceptor;
-import org.apache.mina.transport.socket.SocketSessionConfig;
 import org.apache.mina.transport.socket.nio.NioSocketAcceptor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;


[40/50] [abbrv] git commit: No need to check for null when using instanceof

Posted by ng...@apache.org.
No need to check for null when using instanceof

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1137729 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/a7251f68
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/a7251f68
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/a7251f68

Branch: refs/heads/trunk
Commit: a7251f68ff5e2c4465db73a83612a32dc4ecdfa0
Parents: 54cdbbb
Author: Sebastian Bazley <se...@apache.org>
Authored: Mon Jun 20 18:15:11 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Mon Jun 20 18:15:11 2011 +0000

----------------------------------------------------------------------
 .../apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/a7251f68/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
index 6e833dc..4052ff6 100644
--- a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
+++ b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
@@ -396,7 +396,7 @@ public class NativeFtpFile implements FtpFile {
 
     @Override
     public boolean equals(Object obj) {
-        if (obj != null && obj instanceof NativeFtpFile) {
+        if (obj instanceof NativeFtpFile) {
             File thisCanonicalFile;
             File otherCanonicalFile;
             try {


[07/50] [abbrv] git commit: Unnecessary casts

Posted by ng...@apache.org.
Unnecessary casts

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129739 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/372c4ef0
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/372c4ef0
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/372c4ef0

Branch: refs/heads/trunk
Commit: 372c4ef07d9ef7ecad2581c28f07caab44493303
Parents: 3cb3f6b
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:09:47 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:09:47 2011 +0000

----------------------------------------------------------------------
 core/src/test/java/org/apache/ftpserver/test/TestUtil.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/372c4ef0/core/src/test/java/org/apache/ftpserver/test/TestUtil.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/test/TestUtil.java b/core/src/test/java/org/apache/ftpserver/test/TestUtil.java
index 1db31fe..871cb24 100644
--- a/core/src/test/java/org/apache/ftpserver/test/TestUtil.java
+++ b/core/src/test/java/org/apache/ftpserver/test/TestUtil.java
@@ -123,11 +123,11 @@ public class TestUtil {
 
         List<String> hostIps = new ArrayList<String>();
         while (nifs.hasMoreElements()) {
-            NetworkInterface nif = (NetworkInterface) nifs.nextElement();
+            NetworkInterface nif = nifs.nextElement();
             Enumeration<InetAddress> ips = nif.getInetAddresses();
 
             while (ips.hasMoreElements()) {
-                InetAddress ip = (InetAddress) ips.nextElement();
+                InetAddress ip = ips.nextElement();
                 if (ip instanceof java.net.Inet4Address) {
                     hostIps.add(ip.getHostAddress());
                 } else {
@@ -144,11 +144,11 @@ public class TestUtil {
                 .getNetworkInterfaces();
 
         while (nifs.hasMoreElements()) {
-            NetworkInterface nif = (NetworkInterface) nifs.nextElement();
+            NetworkInterface nif = nifs.nextElement();
             Enumeration<InetAddress> ips = nif.getInetAddresses();
 
             while (ips.hasMoreElements()) {
-                InetAddress ip = (InetAddress) ips.nextElement();
+                InetAddress ip = ips.nextElement();
                 if (ip instanceof java.net.Inet4Address
                         && !ip.isLoopbackAddress()) {
                     return ip;


[05/50] [abbrv] git commit: Remove unnecessary tags

Posted by ng...@apache.org.
Remove unnecessary tags

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129735 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/ccbea002
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/ccbea002
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/ccbea002

Branch: refs/heads/trunk
Commit: ccbea0029d2b99f61597af5d33aaa79226d3ae5a
Parents: 5bcab53
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:08:52 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:08:52 2011 +0000

----------------------------------------------------------------------
 .../src/test/java/org/apache/ftpserver/clienttests/MFMTTest.java | 4 +---
 .../ftpserver/commands/impl/listing/MLSTFileFormaterTest.java    | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/ccbea002/core/src/test/java/org/apache/ftpserver/clienttests/MFMTTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/clienttests/MFMTTest.java b/core/src/test/java/org/apache/ftpserver/clienttests/MFMTTest.java
index fe84b49..1e15bd2 100644
--- a/core/src/test/java/org/apache/ftpserver/clienttests/MFMTTest.java
+++ b/core/src/test/java/org/apache/ftpserver/clienttests/MFMTTest.java
@@ -112,7 +112,6 @@ public class MFMTTest extends ClientTestTemplate {
         assertTrue(result.contains(" MFMT\r\n"));
     }
 
-    @SuppressWarnings("deprecation")
     public void testSetTime() throws Exception {
         
         assertEquals(213, client.sendCommand("MFMT", "20020717210715 test1.txt"));
@@ -120,13 +119,12 @@ public class MFMTTest extends ClientTestTemplate {
         assertEquals(EXPECTED_TIME.getTimeInMillis(),TEST_FILE1.lastModified());
     }
     
-    @SuppressWarnings("deprecation")
     public void testSetTimeFullPath() throws Exception {
         assertEquals(213, client.sendCommand("MFMT", "20020717210715 dir1/test4.txt"));
         
         assertEquals(EXPECTED_TIME.getTimeInMillis(), TEST_FILE_IN_DIR1.lastModified());
     }
-    @SuppressWarnings("deprecation")
+
     public void testSetTimeFileWithSpaces() throws Exception{
         assertEquals(213, client.sendCommand("MFMT", "20020717210715 my test.txt"));
         

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/ccbea002/core/src/test/java/org/apache/ftpserver/commands/impl/listing/MLSTFileFormaterTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/commands/impl/listing/MLSTFileFormaterTest.java b/core/src/test/java/org/apache/ftpserver/commands/impl/listing/MLSTFileFormaterTest.java
index f3edb6d..724c8e3 100644
--- a/core/src/test/java/org/apache/ftpserver/commands/impl/listing/MLSTFileFormaterTest.java
+++ b/core/src/test/java/org/apache/ftpserver/commands/impl/listing/MLSTFileFormaterTest.java
@@ -36,7 +36,6 @@ import org.apache.ftpserver.ftplet.FtpFile;
 * @author <a href="http://mina.apache.org">Apache MINA Project</a>
 *
 */
-@SuppressWarnings("deprecation")
 public class MLSTFileFormaterTest extends TestCase {
 
     private static final Calendar LAST_MODIFIED_IN_2005 = Calendar.getInstance(TimeZone.getTimeZone("GMT")); 


[39/50] [abbrv] git commit: Replacing expired example certificate (FTPSERVER-404)

Posted by ng...@apache.org.
Replacing expired example certificate (FTPSERVER-404)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1137421 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/54cdbbb7
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/54cdbbb7
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/54cdbbb7

Branch: refs/heads/trunk
Commit: 54cdbbb7f98add7f37e24ccf814e4688a869485c
Parents: 63bf7c8
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Sun Jun 19 19:31:19 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Sun Jun 19 19:31:19 2011 +0000

----------------------------------------------------------------------
 distribution/res/ftpserver.jks | Bin 1242 -> 1262 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/54cdbbb7/distribution/res/ftpserver.jks
----------------------------------------------------------------------
diff --git a/distribution/res/ftpserver.jks b/distribution/res/ftpserver.jks
index 5de00f9..c9487a9 100644
Binary files a/distribution/res/ftpserver.jks and b/distribution/res/ftpserver.jks differ


[19/50] [abbrv] git commit: Fix eol-style

Posted by ng...@apache.org.
Fix eol-style

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129822 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/9988eb9d
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/9988eb9d
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/9988eb9d

Branch: refs/heads/trunk
Commit: 9988eb9d868f3a5e4264c09796c175d18475796d
Parents: 6093777
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 17:42:45 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 17:42:45 2011 +0000

----------------------------------------------------------------------

----------------------------------------------------------------------



[37/50] [abbrv] git commit: Adding hashCode() to NativeFtpFile (FTPSERVER-375)

Posted by ng...@apache.org.
Adding hashCode() to NativeFtpFile (FTPSERVER-375)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1137326 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/b8f35431
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/b8f35431
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/b8f35431

Branch: refs/heads/trunk
Commit: b8f3543159d2b9d86a199f299ca6b7b9f7b7ae36
Parents: b163d4a
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Sun Jun 19 09:50:58 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Sun Jun 19 09:50:58 2011 +0000

----------------------------------------------------------------------
 .../filesystem/nativefs/impl/NativeFtpFile.java       | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b8f35431/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
index f6f419a..c53f7c0 100644
--- a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
+++ b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
@@ -394,10 +394,6 @@ public class NativeFtpFile implements FtpFile {
         };
     }
 
-
-
-
-    
     @Override
     public boolean equals(Object obj) {
         if (obj != null && obj instanceof NativeFtpFile) {
@@ -416,4 +412,14 @@ public class NativeFtpFile implements FtpFile {
         }
         return false;
     }
+    
+	@Override
+	public int hashCode() {
+		final int prime = 31;
+		try {
+			return prime  + ((file == null) ? 0 : file.getCanonicalFile().hashCode());
+		} catch (IOException e) {
+			return prime;
+		}
+	}
 }


[21/50] [abbrv] git commit: Fix eol-style

Posted by ng...@apache.org.
Fix eol-style

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129825 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/61e2d0f1
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/61e2d0f1
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/61e2d0f1

Branch: refs/heads/trunk
Commit: 61e2d0f12c80ca19072ed1c007a37c5b872ab6b8
Parents: d040ac3
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 17:43:32 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 17:43:32 2011 +0000

----------------------------------------------------------------------
 .../ftpserver/ftplet/DataTransferFtpReply.java  | 80 ++++++++--------
 .../ftpserver/ftplet/FileActionFtpReply.java    | 80 ++++++++--------
 .../apache/ftpserver/ftplet/RenameFtpReply.java | 96 ++++++++++----------
 3 files changed, 128 insertions(+), 128 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/61e2d0f1/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java
----------------------------------------------------------------------
diff --git a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java
index d2b062c..2eaff15 100644
--- a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java
+++ b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/DataTransferFtpReply.java
@@ -1,40 +1,40 @@
-/*
- * 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.ftpserver.ftplet;
-
-/**
- * A more specific type of FTP reply that is sent by the commands that transfer
- * data over the data connection. These commands include LIST, RETR, STOR, STOU
- * etc.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public interface DataTransferFtpReply extends FileActionFtpReply {
-
-	/**
-	 * Returns the number of bytes transferred.
-	 * 
-	 * @return the number of bytes transferred.
-	 */
-	long getBytesTransferred();
-
-}
+/*
+ * 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.ftpserver.ftplet;
+
+/**
+ * A more specific type of FTP reply that is sent by the commands that transfer
+ * data over the data connection. These commands include LIST, RETR, STOR, STOU
+ * etc.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public interface DataTransferFtpReply extends FileActionFtpReply {
+
+	/**
+	 * Returns the number of bytes transferred.
+	 * 
+	 * @return the number of bytes transferred.
+	 */
+	long getBytesTransferred();
+
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/61e2d0f1/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java
----------------------------------------------------------------------
diff --git a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java
index 2eb3895..7130e8f 100644
--- a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java
+++ b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileActionFtpReply.java
@@ -1,40 +1,40 @@
-/*
- * 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.ftpserver.ftplet;
-
-/**
- * A more specific type of FtpReply that is sent for commands that act on a
- * single file or directory such as MKD, DELE, RMD etc.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public interface FileActionFtpReply extends FtpReply {
-
-	/**
-	 * Returns the file (or directory) on which the action was taken 
-	 * (e.g. uploaded, created, listed)
-	 * 
-	 * @return the file on which the action was taken. May return
-	 *         <code>null</code>, if the file information is not available.
-	 */
-	public FtpFile getFile();
-}
+/*
+ * 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.ftpserver.ftplet;
+
+/**
+ * A more specific type of FtpReply that is sent for commands that act on a
+ * single file or directory such as MKD, DELE, RMD etc.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public interface FileActionFtpReply extends FtpReply {
+
+	/**
+	 * Returns the file (or directory) on which the action was taken 
+	 * (e.g. uploaded, created, listed)
+	 * 
+	 * @return the file on which the action was taken. May return
+	 *         <code>null</code>, if the file information is not available.
+	 */
+	public FtpFile getFile();
+}

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/61e2d0f1/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java
----------------------------------------------------------------------
diff --git a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java
index 109ee32..9d88af3 100644
--- a/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java
+++ b/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/RenameFtpReply.java
@@ -1,48 +1,48 @@
-/*
- * 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.ftpserver.ftplet;
-
-/**
- * A more specific type of reply that is sent when a file is attempted to
- * rename. This reply is sent by the RNTO command.
- * 
- * @author <a href="http://mina.apache.org">Apache MINA Project</a>
- * 
- */
-
-public interface RenameFtpReply extends FtpReply {
-
-	/**
-	 * Returns the file before the rename.
-	 * 
-	 * @return the file before the rename. May return <code>null</code>, if
-	 *         the file information is not available.
-	 */
-	public FtpFile getFrom();
-
-	/**
-	 * Returns the file after the rename.
-	 * 
-	 * @return the file after the rename. May return <code>null</code>, if
-	 *         the file information is not available.
-	 */
-	public FtpFile getTo();
-
-}
+/*
+ * 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.ftpserver.ftplet;
+
+/**
+ * A more specific type of reply that is sent when a file is attempted to
+ * rename. This reply is sent by the RNTO command.
+ * 
+ * @author <a href="http://mina.apache.org">Apache MINA Project</a>
+ * 
+ */
+
+public interface RenameFtpReply extends FtpReply {
+
+	/**
+	 * Returns the file before the rename.
+	 * 
+	 * @return the file before the rename. May return <code>null</code>, if
+	 *         the file information is not available.
+	 */
+	public FtpFile getFrom();
+
+	/**
+	 * Returns the file after the rename.
+	 * 
+	 * @return the file after the rename. May return <code>null</code>, if
+	 *         the file information is not available.
+	 */
+	public FtpFile getTo();
+
+}


[49/50] [abbrv] git commit: Return Executor instead of concrete class in FSC

Posted by ng...@apache.org.
Return Executor instead of concrete class in FSC

In FtpServerContext, we should return the Executor interface as opposed
to the concrete ThreadPoolExecutor class.

FTPSERVER-445


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/cd4e9e00
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/cd4e9e00
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/cd4e9e00

Branch: refs/heads/trunk
Commit: cd4e9e00ff15662314e56c55f548d73440b7456b
Parents: c39b822
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Sun Aug 11 23:57:51 2013 +0200
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Mon Aug 12 00:14:35 2013 +0200

----------------------------------------------------------------------
 .../org/apache/ftpserver/impl/DefaultFtpServerContext.java    | 7 ++++---
 .../main/java/org/apache/ftpserver/impl/FtpServerContext.java | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/cd4e9e00/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpServerContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpServerContext.java b/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpServerContext.java
index 731b0f5..36b320e 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpServerContext.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpServerContext.java
@@ -23,7 +23,8 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ExecutorService;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.ftpserver.ConnectionConfig;
@@ -85,8 +86,8 @@ public class DefaultFtpServerContext implements FtpServerContext {
     /**
      * The thread pool executor to be used by the server using this context
      */
-    private ThreadPoolExecutor threadPoolExecutor = null;
     
+    private ExecutorService threadPoolExecutor = null;
     static {
         ADMIN_AUTHORITIES.add(new WritePermission());
         
@@ -262,7 +263,7 @@ public class DefaultFtpServerContext implements FtpServerContext {
         this.connectionConfig = connectionConfig;
     }
     
-    public synchronized ThreadPoolExecutor getThreadPoolExecutor() {
+    public synchronized Executor getThreadPoolExecutor() {
         if(threadPoolExecutor == null) {
             int maxThreads = connectionConfig.getMaxThreads();
             if(maxThreads < 1) {

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/cd4e9e00/core/src/main/java/org/apache/ftpserver/impl/FtpServerContext.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/FtpServerContext.java b/core/src/main/java/org/apache/ftpserver/impl/FtpServerContext.java
index a5eb145..70868e3 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/FtpServerContext.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/FtpServerContext.java
@@ -20,7 +20,7 @@
 package org.apache.ftpserver.impl;
 
 import java.util.Map;
-import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.Executor;
 
 import org.apache.ftpserver.ConnectionConfig;
 import org.apache.ftpserver.command.CommandFactory;
@@ -69,5 +69,5 @@ public interface FtpServerContext extends FtpletContext {
      * Returns the thread pool executor for this context.  
      * @return the thread pool executor for this context.
      */
-    ThreadPoolExecutor getThreadPoolExecutor();
+    Executor getThreadPoolExecutor();
 }


[09/50] [abbrv] git commit: Unnecessary throws clause

Posted by ng...@apache.org.
Unnecessary throws clause

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129744 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/733e0b19
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/733e0b19
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/733e0b19

Branch: refs/heads/trunk
Commit: 733e0b19ff459102aadd6c561e71e80bbba6a23d
Parents: 5987bc5
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:11:23 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:11:23 2011 +0000

----------------------------------------------------------------------
 .../ftpserver/ftpletcontainer/FtpLetContainerTestTemplate.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/733e0b19/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetContainerTestTemplate.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetContainerTestTemplate.java b/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetContainerTestTemplate.java
index e79c154..927efb8 100644
--- a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetContainerTestTemplate.java
+++ b/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetContainerTestTemplate.java
@@ -73,7 +73,7 @@ public abstract class FtpLetContainerTestTemplate extends TestCase {
         }
     }
     
-    public void testAddAndGetFtplet() throws FtpException {
+    public void testAddAndGetFtplet() {
         MockFtplet ftplet1 = new MockFtplet();
         MockFtplet ftplet2 = new MockFtplet();
 


[12/50] [abbrv] git commit: We want Integers not ints

Posted by ng...@apache.org.
We want Integers not ints

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129749 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/860514ee
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/860514ee
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/860514ee

Branch: refs/heads/trunk
Commit: 860514eec58c8fd6c9ae19727fcbb6d2fd860cb0
Parents: af45371
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:13:30 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:13:30 2011 +0000

----------------------------------------------------------------------
 .../config/spring/CommandFactoryBeanDefinitionParser.java        | 2 +-
 .../ftpserver/config/spring/FileSystemBeanDefinitionParser.java  | 4 ++--
 .../ftpserver/config/spring/ListenerBeanDefinitionParser.java    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/860514ee/core/src/main/java/org/apache/ftpserver/config/spring/CommandFactoryBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/config/spring/CommandFactoryBeanDefinitionParser.java b/core/src/main/java/org/apache/ftpserver/config/spring/CommandFactoryBeanDefinitionParser.java
index 6239cf0..9b56e00 100644
--- a/core/src/main/java/org/apache/ftpserver/config/spring/CommandFactoryBeanDefinitionParser.java
+++ b/core/src/main/java/org/apache/ftpserver/config/spring/CommandFactoryBeanDefinitionParser.java
@@ -73,7 +73,7 @@ public class CommandFactoryBeanDefinitionParser extends
 
         if (StringUtils.hasText(element.getAttribute("use-default"))) {
             factoryBuilder.addPropertyValue("useDefaultCommands", Boolean
-                    .parseBoolean(element.getAttribute("use-default")));
+                    .valueOf(element.getAttribute("use-default")));
         }
         
         BeanDefinition factoryDefinition = factoryBuilder.getBeanDefinition();

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/860514ee/core/src/main/java/org/apache/ftpserver/config/spring/FileSystemBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/config/spring/FileSystemBeanDefinitionParser.java b/core/src/main/java/org/apache/ftpserver/config/spring/FileSystemBeanDefinitionParser.java
index 8aa1ff6..a35db35 100644
--- a/core/src/main/java/org/apache/ftpserver/config/spring/FileSystemBeanDefinitionParser.java
+++ b/core/src/main/java/org/apache/ftpserver/config/spring/FileSystemBeanDefinitionParser.java
@@ -53,11 +53,11 @@ public class FileSystemBeanDefinitionParser extends
             final BeanDefinitionBuilder builder) {
         if (StringUtils.hasText(element.getAttribute("case-insensitive"))) {
             builder.addPropertyValue("caseInsensitive", Boolean
-                    .parseBoolean(element.getAttribute("case-insensitive")));
+                    .valueOf(element.getAttribute("case-insensitive")));
         }
         if (StringUtils.hasText(element.getAttribute("create-home"))) {
             builder.addPropertyValue("createHome", Boolean
-                    .parseBoolean(element.getAttribute("create-home")));
+                    .valueOf(element.getAttribute("create-home")));
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/860514ee/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java b/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
index ec50d80..c367669 100644
--- a/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
+++ b/core/src/main/java/org/apache/ftpserver/config/spring/ListenerBeanDefinitionParser.java
@@ -69,7 +69,7 @@ public class ListenerBeanDefinitionParser extends
         BeanDefinitionBuilder factoryBuilder = BeanDefinitionBuilder.genericBeanDefinition(ListenerFactory.class);
 
         if (StringUtils.hasText(element.getAttribute("port"))) {
-            factoryBuilder.addPropertyValue("port", Integer.parseInt(element
+            factoryBuilder.addPropertyValue("port", Integer.valueOf(element
                     .getAttribute("port")));
         }
 


[30/50] [abbrv] git commit: Fix tagbase (no longer in sandbox)

Posted by ng...@apache.org.
Fix tagbase (no longer in sandbox)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1130115 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/222f2fc2
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/222f2fc2
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/222f2fc2

Branch: refs/heads/trunk
Commit: 222f2fc213a741bca0f70e23e5564c0178b8bf60
Parents: 5f980c7
Author: Sebastian Bazley <se...@apache.org>
Authored: Wed Jun 1 11:58:37 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Wed Jun 1 11:58:37 2011 +0000

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/222f2fc2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a9f5a84..54758fc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -262,7 +262,7 @@
         <artifactId>maven-release-plugin</artifactId>
         <version>2.0-beta-7</version>
         <configuration>
-          <tagBase>https://svn.apache.org/repos/asf/mina/sandbox/ftpserver/tags/</tagBase>
+          <tagBase>https://svn.apache.org/repos/asf/mina/ftpserver/tags/</tagBase>
         </configuration>
       </plugin>
 


[04/50] [abbrv] git commit: Add missing @Override annotations

Posted by ng...@apache.org.
Add missing @Override annotations

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129719 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/5bcab531
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/5bcab531
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/5bcab531

Branch: refs/heads/trunk
Commit: 5bcab531a86acd12e92ef099cbdfa09e78b53b86
Parents: b71a25f
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 14:49:31 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 14:49:31 2011 +0000

----------------------------------------------------------------------
 .../apache/ftpserver/config/spring/ServerBeanDefinitionParser.java | 1 +
 .../apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java   | 2 ++
 .../src/main/java/org/apache/ftpserver/impl/DefaultFtpRequest.java | 1 +
 core/src/main/java/org/apache/ftpserver/main/AddUser.java          | 1 +
 .../main/java/org/apache/ftpserver/usermanager/impl/BaseUser.java  | 1 +
 .../java/org/apache/ftpserver/usermanager/impl/DbUserManager.java  | 1 +
 6 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5bcab531/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java b/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java
index ab6cab2..3e6064e 100644
--- a/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java
+++ b/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java
@@ -50,6 +50,7 @@ public class ServerBeanDefinitionParser extends
     /**
      * {@inheritDoc}
      */
+    @Override
     protected Class<? extends FtpServer> getBeanClass(final Element element) {
         return null;
     }

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5bcab531/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
index 6b8ede3..f6f419a 100644
--- a/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
+++ b/core/src/main/java/org/apache/ftpserver/filesystem/nativefs/impl/NativeFtpFile.java
@@ -361,6 +361,7 @@ public class NativeFtpFile implements FtpFile {
         // The IBM jre needs to have both the stream and the random access file
         // objects closed to actually close the file
         return new FileOutputStream(raf.getFD()) {
+            @Override
             public void close() throws IOException {
                 super.close();
                 raf.close();
@@ -385,6 +386,7 @@ public class NativeFtpFile implements FtpFile {
         // The IBM jre needs to have both the stream and the random access file
         // objects closed to actually close the file
         return new FileInputStream(raf.getFD()) {
+            @Override
             public void close() throws IOException {
                 super.close();
                 raf.close();

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5bcab531/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpRequest.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpRequest.java b/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpRequest.java
index bb58394..a33845c 100644
--- a/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpRequest.java
+++ b/core/src/main/java/org/apache/ftpserver/impl/DefaultFtpRequest.java
@@ -121,6 +121,7 @@ public class DefaultFtpRequest implements FtpRequest {
      * 
      * @see java.lang.Object#toString()
      */
+    @Override
     public String toString() {
         return getRequestLine();
     }

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5bcab531/core/src/main/java/org/apache/ftpserver/main/AddUser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/main/AddUser.java b/core/src/main/java/org/apache/ftpserver/main/AddUser.java
index 38f07be..8dec68c 100644
--- a/core/src/main/java/org/apache/ftpserver/main/AddUser.java
+++ b/core/src/main/java/org/apache/ftpserver/main/AddUser.java
@@ -170,6 +170,7 @@ public class AddUser extends CommandLine {
     /**
      * Print the usage message.
      */
+    @Override
     protected void usage() {
         System.err.println("Usage: java " + AddUser.class.getName() + " [OPTION] [CONFIGFILE]");
         System.err

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5bcab531/core/src/main/java/org/apache/ftpserver/usermanager/impl/BaseUser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/usermanager/impl/BaseUser.java b/core/src/main/java/org/apache/ftpserver/usermanager/impl/BaseUser.java
index cf11655..95a6699 100644
--- a/core/src/main/java/org/apache/ftpserver/usermanager/impl/BaseUser.java
+++ b/core/src/main/java/org/apache/ftpserver/usermanager/impl/BaseUser.java
@@ -169,6 +169,7 @@ public class BaseUser implements User {
     /**
      * String representation.
      */
+    @Override
     public String toString() {
         return name;
     }

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/5bcab531/core/src/main/java/org/apache/ftpserver/usermanager/impl/DbUserManager.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/usermanager/impl/DbUserManager.java b/core/src/main/java/org/apache/ftpserver/usermanager/impl/DbUserManager.java
index 56bb58a..45a3aa6 100644
--- a/core/src/main/java/org/apache/ftpserver/usermanager/impl/DbUserManager.java
+++ b/core/src/main/java/org/apache/ftpserver/usermanager/impl/DbUserManager.java
@@ -270,6 +270,7 @@ public class DbUserManager extends AbstractUserManager {
     /**
      * @return true if user with this login is administrator
      */
+    @Override
     public boolean isAdmin(String login) throws FtpException {
 
         // check input


[11/50] [abbrv] git commit: Raw types

Posted by ng...@apache.org.
Raw types

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129747 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/af45371c
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/af45371c
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/af45371c

Branch: refs/heads/trunk
Commit: af45371cf77cbf5313f8a653ea550bff8ae24d61
Parents: c9aa57e
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:13:01 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:13:01 2011 +0000

----------------------------------------------------------------------
 .../config/spring/ServerBeanDefinitionParser.java         | 10 +++++-----
 .../config/spring/UserManagerBeanDefinitionParser.java    |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/af45371c/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java b/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java
index 3e6064e..c7fbffe 100644
--- a/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java
+++ b/core/src/main/java/org/apache/ftpserver/config/spring/ServerBeanDefinitionParser.java
@@ -70,13 +70,13 @@ public class ServerBeanDefinitionParser extends
             String childName = childElm.getLocalName();
 
             if ("listeners".equals(childName)) {
-                Map listeners = parseListeners(childElm, parserContext, builder);
+                Map<?, ?> listeners = parseListeners(childElm, parserContext, builder);
 
                 if (listeners.size() > 0) {
                     factoryBuilder.addPropertyValue("listeners", listeners);
                 }
             } else if ("ftplets".equals(childName)) {
-                Map ftplets = parseFtplets(childElm, parserContext, builder);
+                Map<?, ?> ftplets = parseFtplets(childElm, parserContext, builder);
                 factoryBuilder.addPropertyValue("ftplets", ftplets);
             } else if ("file-user-manager".equals(childName)
                     || "db-user-manager".equals(childName)) {
@@ -185,7 +185,7 @@ public class ServerBeanDefinitionParser extends
     /**
      * Parse the "ftplets" element
      */
-    private Map parseFtplets(final Element childElm,
+    private Map<?, ?> parseFtplets(final Element childElm,
             final ParserContext parserContext,
             final BeanDefinitionBuilder builder) {
 
@@ -193,7 +193,7 @@ public class ServerBeanDefinitionParser extends
 
         if(childs.size() > 0 && childs.get(0).getLocalName().equals("map")) {
             // using a beans:map element
-            return (Map) parserContext.getDelegate().parseMapElement(
+            return parserContext.getDelegate().parseMapElement(
                     childs.get(0),
                     builder.getBeanDefinition());
         } else {
@@ -213,7 +213,7 @@ public class ServerBeanDefinitionParser extends
      * Parse listeners elements
      */
     @SuppressWarnings("unchecked")
-    private Map parseListeners(final Element listenersElm,
+    private Map<?, ?> parseListeners(final Element listenersElm,
             final ParserContext parserContext,
             final BeanDefinitionBuilder builder) {
         ManagedMap listeners = new ManagedMap();

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/af45371c/core/src/main/java/org/apache/ftpserver/config/spring/UserManagerBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/ftpserver/config/spring/UserManagerBeanDefinitionParser.java b/core/src/main/java/org/apache/ftpserver/config/spring/UserManagerBeanDefinitionParser.java
index 8e56d99..916c65c 100644
--- a/core/src/main/java/org/apache/ftpserver/config/spring/UserManagerBeanDefinitionParser.java
+++ b/core/src/main/java/org/apache/ftpserver/config/spring/UserManagerBeanDefinitionParser.java
@@ -52,7 +52,7 @@ public class UserManagerBeanDefinitionParser extends
             final BeanDefinitionBuilder builder) {
 
 
-        Class factoryClass;
+        Class<?> factoryClass;
         if (element.getLocalName().equals("file-user-manager")) {
             factoryClass = PropertiesUserManagerFactory.class;
         } else {


[36/50] [abbrv] git commit: Upgrading to MINA 2.0.4 (FTPSERVER-421)

Posted by ng...@apache.org.
Upgrading to MINA 2.0.4 (FTPSERVER-421)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1137254 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/b163d4ad
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/b163d4ad
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/b163d4ad

Branch: refs/heads/trunk
Commit: b163d4ad955ac26c71185b9dc6a9a07595f30944
Parents: 4907aac
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Sat Jun 18 21:49:42 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Sat Jun 18 21:49:42 2011 +0000

----------------------------------------------------------------------
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/b163d4ad/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 54758fc..471c389 100644
--- a/pom.xml
+++ b/pom.xml
@@ -153,7 +153,7 @@
       <dependency>
         <groupId>org.apache.mina</groupId>
         <artifactId>mina-core</artifactId>
-        <version>2.0.2</version>
+        <version>2.0.4</version>
       </dependency>
 
     <dependency>


[06/50] [abbrv] git commit: Unnecessary throws clause

Posted by ng...@apache.org.
Unnecessary throws clause

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1129738 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/3cb3f6bd
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/3cb3f6bd
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/3cb3f6bd

Branch: refs/heads/trunk
Commit: 3cb3f6bdd71667fa16d3c96bf08de46ea00a2dc7
Parents: ccbea00
Author: Sebastian Bazley <se...@apache.org>
Authored: Tue May 31 15:09:34 2011 +0000
Committer: Sebastian Bazley <se...@apache.org>
Committed: Tue May 31 15:09:34 2011 +0000

----------------------------------------------------------------------
 .../test/java/org/apache/ftpserver/util/EncryptUtilsTest.java  | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/3cb3f6bd/core/src/test/java/org/apache/ftpserver/util/EncryptUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/util/EncryptUtilsTest.java b/core/src/test/java/org/apache/ftpserver/util/EncryptUtilsTest.java
index 078dbbc..2314e6e 100644
--- a/core/src/test/java/org/apache/ftpserver/util/EncryptUtilsTest.java
+++ b/core/src/test/java/org/apache/ftpserver/util/EncryptUtilsTest.java
@@ -21,8 +21,6 @@ package org.apache.ftpserver.util;
 
 import junit.framework.TestCase;
 
-import org.apache.ftpserver.ftplet.FtpException;
-
 /**
 *
 * @author <a href="http://mina.apache.org">Apache MINA Project</a>
@@ -30,12 +28,12 @@ import org.apache.ftpserver.ftplet.FtpException;
 */
 public class EncryptUtilsTest extends TestCase {
 
-    public void testEncryptMd5() throws FtpException {
+    public void testEncryptMd5() {
         assertEquals("21232F297A57A5A743894A0E4A801FC3", EncryptUtils
                 .encryptMD5("admin"));
     }
 
-    public void testEncryptSha() throws FtpException {
+    public void testEncryptSha() {
         assertEquals("D033E22AE348AEB5660FC2140AEC35850C4DA997", EncryptUtils
                 .encryptSHA("admin"));
     }


[41/50] [abbrv] git commit: Fix broken test, where assert was invoked in a separate thread, and checking the temporary getUserArgument() rather than the correct getUser() (FTPSERVER-418)

Posted by ng...@apache.org.
Fix broken test, where assert was invoked in a separate thread, and checking the temporary getUserArgument() rather than the correct getUser() (FTPSERVER-418)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1138603 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/25e4d86a
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/25e4d86a
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/25e4d86a

Branch: refs/heads/trunk
Commit: 25e4d86acf8222e606893ee5fb4c7f2a33b1ab17
Parents: a7251f6
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Wed Jun 22 20:05:11 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Wed Jun 22 20:05:11 2011 +0000

----------------------------------------------------------------------
 .../ftpletcontainer/FtpLetReturnDefaultTest.java        | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/25e4d86a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDefaultTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDefaultTest.java b/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDefaultTest.java
index cca0c89..16591cf 100644
--- a/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDefaultTest.java
+++ b/core/src/test/java/org/apache/ftpserver/ftpletcontainer/FtpLetReturnDefaultTest.java
@@ -25,6 +25,8 @@ import java.io.File;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.commons.net.ftp.FTPReply;
 import org.apache.ftpserver.FtpServerFactory;
@@ -34,6 +36,7 @@ import org.apache.ftpserver.ftplet.FtpRequest;
 import org.apache.ftpserver.ftplet.FtpSession;
 import org.apache.ftpserver.ftplet.Ftplet;
 import org.apache.ftpserver.ftplet.FtpletResult;
+import org.apache.ftpserver.ftplet.User;
 import org.apache.ftpserver.test.TestUtil;
 
 /**
@@ -83,12 +86,13 @@ public class FtpLetReturnDefaultTest extends ClientTestTemplate {
     }
 
     public void testLogin() throws Exception {
+    	final LinkedBlockingQueue<User> loggedInUser = new LinkedBlockingQueue<User>();
+    	
         MockFtplet.callback = new MockFtpletCallback() {
-            @Override
             public FtpletResult onLogin(FtpSession session, FtpRequest request)
                     throws FtpException, IOException {
-                assertNotNull(session.getUserArgument());
-
+                loggedInUser.add(session.getUser());
+                
                 return super.onLogin(session, request);
             }
 
@@ -96,6 +100,8 @@ public class FtpLetReturnDefaultTest extends ClientTestTemplate {
         MockFtpletCallback.returnValue = FtpletResult.DEFAULT;
 
         assertTrue(client.login(ADMIN_USERNAME, ADMIN_PASSWORD));
+
+        assertNotNull(loggedInUser.poll(2000, TimeUnit.MILLISECONDS));
     }
 
     public void testDelete() throws Exception {


[28/50] [abbrv] git commit: Removing oro dependency (FTPSERVER-416)

Posted by ng...@apache.org.
Removing oro dependency (FTPSERVER-416)

git-svn-id: https://svn.apache.org/repos/asf/mina/ftpserver/trunk@1130075 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/commit/7ee29360
Tree: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/tree/7ee29360
Diff: http://git-wip-us.apache.org/repos/asf/mina-ftpserver/diff/7ee29360

Branch: refs/heads/trunk
Commit: 7ee29360c2fe524c7b19c916138917baab8f9608
Parents: a3d156c
Author: Niklas Gustavsson <ng...@apache.org>
Authored: Wed Jun 1 09:58:07 2011 +0000
Committer: Niklas Gustavsson <ng...@apache.org>
Committed: Wed Jun 1 09:58:07 2011 +0000

----------------------------------------------------------------------
 core/pom.xml | 5 -----
 pom.xml      | 6 ------
 2 files changed, 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/7ee29360/core/pom.xml
----------------------------------------------------------------------
diff --git a/core/pom.xml b/core/pom.xml
index aee4e09..34de129 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -183,11 +183,6 @@
 			<scope>test</scope>
 		</dependency>
 		<dependency>
-			<groupId>oro</groupId>
-			<artifactId>oro</artifactId>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
 			<groupId>hsqldb</groupId>
 			<artifactId>hsqldb</artifactId>
 			<scope>test</scope>

http://git-wip-us.apache.org/repos/asf/mina-ftpserver/blob/7ee29360/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index de996fe..fd32f44 100644
--- a/pom.xml
+++ b/pom.xml
@@ -214,12 +214,6 @@
       </dependency>
 
       <dependency>
-        <groupId>oro</groupId>
-        <artifactId>oro</artifactId>
-        <version>2.0.8</version>
-      </dependency>
-
-      <dependency>
         <groupId>hsqldb</groupId>
         <artifactId>hsqldb</artifactId>
         <version>1.8.0.7</version>