svn commit: r1713488 - in /commons/proper/validator/trunk/src: changes/changes.xml main/java/org/apache/commons/validator/routines/UrlValidator.java site/xdoc/download_validator.xml test/java/org/apac
Author: sebb Date: Mon Nov 9 17:48:28 2015 New Revision: 1713488 URL: http://svn.apache.org/viewvc?rev=1713488&view=rev Log: VALIDATOR-353 UrlValidator does not allow for optional userinfo in the authority Modified: commons/proper/validator/trunk/src/changes/changes.xml commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java commons/proper/validator/trunk/src/site/xdoc/download_validator.xml commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1713488&r1=1713487&r2=1713488&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Mon Nov 9 17:48:28 2015 @@ -90,6 +90,9 @@ The dependencies for Validator have not For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html "> + +UrlValidator does not allow for optional userinfo in the authority + ISSN validator and converter to EAN-13 Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1713488&r1=1713487&r2=1713488&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Mon Nov 9 17:48:28 2015 @@ -136,9 +136,18 @@ public class UrlValidator implements Ser private static final String AUTHORITY_CHARS_REGEX = "\\p{Alnum}\\-\\."; // allows for IPV4 but not IPV6 private static final String IPV6_REGEX = "[0-9a-fA-F:]+"; // do this as separate match because : could cause ambiguity with port prefix +// userinfo= *( unreserved / pct-encoded / sub-delims / ":" ) +// unreserved= ALPHA / DIGIT / "-" / "." / "_" / "~" +// sub-delims= "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" +// We assume that password has the same valid chars as user info +private static final String USERINFO_CHARS_REGEX = "[a-zA-Z0-9%-._~!$&'()*+,;=]"; +// since neither ':' nor '@' are allowed chars, we don't need to use non-greedy matching +private static final String USERINFO_FIELD_REGEX = +USERINFO_CHARS_REGEX + "+:" + // At least one character for the name +USERINFO_CHARS_REGEX + "*@"; // password may be absent private static final String AUTHORITY_REGEX = -"^(?:\\[("+IPV6_REGEX+")\\]|([" + AUTHORITY_CHARS_REGEX + "]*))(:\\d*)?(.*)?"; -// 1 23 4 +"^(?:\\[("+IPV6_REGEX+")\\]|(?:(?:"+USERINFO_FIELD_REGEX+")?([" + AUTHORITY_CHARS_REGEX + "]*)))(:\\d*)?(.*)?"; +// 1 e.g. user:pass@ 2 3 4 private static final Pattern AUTHORITY_PATTERN = Pattern.compile(AUTHORITY_REGEX); private static final int PARSE_AUTHORITY_IPV6 = 1; Modified: commons/proper/validator/trunk/src/site/xdoc/download_validator.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/site/xdoc/download_validator.xml?rev=1713488&r1=1713487&r2=1713488&view=diff == --- commons/proper/validator/trunk/src/site/xdoc/download_validator.xml (original) +++ commons/proper/validator/trunk/src/site/xdoc/download_validator.xml Mon Nov 9 17:48:28 2015 @@ -95,62 +95,62 @@ limitations under the License. - + - commons-validator-1.4.1-bin.tar.gz - http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1-bin.tar.gz.md5";>md5 - http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1-bin.tar.gz.asc";>pgp + commons-validator-1.5.0-bin.tar.gz + http://www.apache.org/dist/commons/validator/binaries/commons-validator-1.5.0-bin.tar.gz.md5";>md5 +
svn commit: r1777131 - /commons/cms-site/trunk/doap/doap_jcs.rdf
Author: sebb Date: Tue Jan 3 14:55:47 2017 New Revision: 1777131 URL: http://svn.apache.org/viewvc?rev=1777131&view=rev Log: Syntax Modified: commons/cms-site/trunk/doap/doap_jcs.rdf Modified: commons/cms-site/trunk/doap/doap_jcs.rdf URL: http://svn.apache.org/viewvc/commons/cms-site/trunk/doap/doap_jcs.rdf?rev=1777131&r1=1777130&r2=1777131&view=diff == --- commons/cms-site/trunk/doap/doap_jcs.rdf (original) +++ commons/cms-site/trunk/doap/doap_jcs.rdf Tue Jan 3 14:55:47 2017 @@ -50,14 +50,12 @@ - - - commons-jcs - 2015-02-22 - 2.0-beta-1 - - - + +commons-jcs +2015-02-22 +2.0-beta-1 + + commons-jcs
svn commit: r1781587 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
Author: sebb Date: Fri Feb 3 18:58:57 2017 New Revision: 1781587 URL: http://svn.apache.org/viewvc?rev=1781587&view=rev Log: Sort by country-code Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java?rev=1781587&r1=1781586&r2=1781587&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java Fri Feb 3 18:58:57 2017 @@ -94,78 +94,78 @@ public class IBANValidator { */ private static final Validator[] DEFAULT_FORMATS = { -new Validator("AL", 28, "AL\\d{10}[A-Z0-9]{16}" ), // Albania new Validator("AD", 24, "AD\\d{10}[A-Z0-9]{12}" ), // Andorra +new Validator("AE", 23, "AE\\d{21}" ), // United Arab Emirates +new Validator("AL", 28, "AL\\d{10}[A-Z0-9]{16}" ), // Albania new Validator("AT", 20, "AT\\d{18}" ), // Austria new Validator("AZ", 28, "AZ\\d{2}[A-Z]{4}[A-Z0-9]{20}" ), // Republic of Azerbaijan -new Validator("BH", 22, "BH\\d{2}[A-Z]{4}[A-Z0-9]{14}" ), // Bahrain (Kingdom of) -new Validator("BE", 16, "BE\\d{14}" ), // Belgium new Validator("BA", 20, "BA\\d{18}" ), // Bosnia and Herzegovina -new Validator("BR", 29, "BR\\d{25}[A-Z]{1}[A-Z0-9]{1}" ), // Brazil +new Validator("BE", 16, "BE\\d{14}" ), // Belgium new Validator("BG", 22, "BG\\d{2}[A-Z]{4}\\d{6}[A-Z0-9]{8}" ), // Bulgaria +new Validator("BH", 22, "BH\\d{2}[A-Z]{4}[A-Z0-9]{14}" ), // Bahrain (Kingdom of) +new Validator("BR", 29, "BR\\d{25}[A-Z]{1}[A-Z0-9]{1}" ), // Brazil +new Validator("CH", 21, "CH\\d{7}[A-Z0-9]{12}" ), // Switzerland new Validator("CR", 22, "CR\\d{20}" ), // Costa Rica -new Validator("HR", 21, "HR\\d{19}" ), // Croatia new Validator("CY", 28, "CY\\d{10}[A-Z0-9]{16}" ), // Cyprus new Validator("CZ", 24, "CZ\\d{22}" ), // Czech Republic +new Validator("DE", 22, "DE\\d{20}" ), // Germany new Validator("DK", 18, "DK\\d{16}" ), // Denmark -new Validator("FO", 18, "FO\\d{16}" ), // Denmark (Faroes) -new Validator("GL", 18, "GL\\d{16}" ), // Denmark (Greenland) new Validator("DO", 28, "DO\\d{2}[A-Z0-9]{4}\\d{20}"), // Dominican Republic new Validator("EE", 20, "EE\\d{18}" ), // Estonia +new Validator("ES", 24, "ES\\d{22}" ), // Spain new Validator("FI", 18, "FI\\d{16}" ), // Finland +new Validator("FO", 18, "FO\\d{16}" ), // Denmark (Faroes) new Validator("FR", 27, "FR\\d{12}[A-Z0-9]{11}\\d{2}" ), // France +new Validator("GB", 22, "GB\\d{2}[A-Z]{4}\\d{14}" ), // United Kingdom new Validator("GE", 22, "GE\\d{2}[A-Z]{2}\\d{16}" ), // Georgia -new Validator("DE", 22, "DE\\d{20}" ), // Germany new Validator("GI", 23, "GI\\d{2}[A-Z]{4}[A-Z0-9]{15}" ), // Gibraltar +new Validator("GL", 18, "GL\\d{16}" ), // Denmark (Green
svn commit: r1781591 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java
Author: sebb Date: Fri Feb 3 20:16:01 2017 New Revision: 1781591 URL: http://svn.apache.org/viewvc?rev=1781591&view=rev Log: Santa Lucia format is LC2!n4!a24!c not LC2!n4!a24!n Minor other tweaks Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java?rev=1781591&r1=1781590&r2=1781591&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java Fri Feb 3 20:16:01 2017 @@ -132,7 +132,7 @@ public class IBANValidator { new Validator("KW", 30, "KW\\d{2}[A-Z]{4}[A-Z0-9]{22}" ), // Kuwait new Validator("KZ", 20, "KZ\\d{5}[A-Z0-9]{13}" ), // Kazakhstan new Validator("LB", 28, "LB\\d{6}[A-Z0-9]{20}" ), // Lebanon -new Validator("LC", 32, "LC\\d{2}[A-Z]{4}\\d{24}" ), // Saint Lucia +new Validator("LC", 32, "LC\\d{2}[A-Z]{4}[A-Z0-9]{24}" ), // Saint Lucia new Validator("LI", 21, "LI\\d{7}[A-Z0-9]{12}" ), // Liechtenstein (Principality of) new Validator("LT", 20, "LT\\d{18}" ), // Lithuania new Validator("LU", 20, "LU\\d{5}[A-Z0-9]{13}" ), // Luxembourg @@ -141,7 +141,7 @@ public class IBANValidator { new Validator("MD", 24, "MD\\d{2}[A-Z0-9]{20}" ), // Moldova new Validator("ME", 22, "ME\\d{20}" ), // Montenegro new Validator("MK", 19, "MK\\d{5}[A-Z0-9]{10}\\d{2}"), // Macedonia, Former Yugoslav Republic of -new Validator("MR", 27, "MR13\\d{23}" ), // Mauritania +new Validator("MR", 27, "MR\\d{25}" ), // Mauritania new Validator("MT", 31, "MT\\d{2}[A-Z]{4}\\d{5}[A-Z0-9]{18}"), // Malta new Validator("MU", 30, "MU\\d{2}[A-Z]{4}\\d{19}[A-Z]{3}" ), // Mauritius new Validator("NL", 18, "NL\\d{2}[A-Z]{4}\\d{10}" ), // The Netherlands @@ -159,9 +159,9 @@ public class IBANValidator { new Validator("SI", 19, "SI\\d{17}" ), // Slovenia new Validator("SK", 24, "SK\\d{22}" ), // Slovak Republic new Validator("SM", 27, "SM\\d{2}[A-Z]{1}\\d{10}[A-Z0-9]{12}" ), // San Marino -new Validator("ST", 25, "ST\\d{23}" ), // Sao Tome And Principe +new Validator("ST", 25, "ST\\d{23}" ), // Sao Tome and Principe new Validator("TL", 23, "TL\\d{21}" ), // Timor-Leste -new Validator("TN", 24, "TN59\\d{20}" ), // Tunisia +new Validator("TN", 24, "TN\\d{22}" ), // Tunisia new Validator("TR", 26, "TR\\d{8}[A-Z0-9]{16}" ), // Turkey new Validator("UA", 29, "UA\\d{8}[A-Z0-9]{19}" ), // Ukraine new Validator("VG", 24, "VG\\d{2}[A-Z]{4}\\d{16}" ), // Virgin Islands, British
svn commit: r1781595 - in /commons/proper/validator/trunk/src: main/java/org/apache/commons/validator/routines/IBANValidator.java test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
Author: sebb Date: Fri Feb 3 20:34:32 2017 New Revision: 1781595 URL: http://svn.apache.org/viewvc?rev=1781595&view=rev Log: Add Belarus (BY) and Iraq (IQ) Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java?rev=1781595&r1=1781594&r2=1781595&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IBANValidator.java Fri Feb 3 20:34:32 2017 @@ -104,6 +104,7 @@ public class IBANValidator { new Validator("BG", 22, "BG\\d{2}[A-Z]{4}\\d{6}[A-Z0-9]{8}" ), // Bulgaria new Validator("BH", 22, "BH\\d{2}[A-Z]{4}[A-Z0-9]{14}" ), // Bahrain (Kingdom of) new Validator("BR", 29, "BR\\d{25}[A-Z]{1}[A-Z0-9]{1}" ), // Brazil +new Validator("BY", 28, "BY\\d{2}[A-Z0-9]{4}\\d{4}[A-Z0-9]{16}" ), // Republic of Belarus new Validator("CH", 21, "CH\\d{7}[A-Z0-9]{12}" ), // Switzerland new Validator("CR", 22, "CR\\d{20}" ), // Costa Rica new Validator("CY", 28, "CY\\d{10}[A-Z0-9]{16}" ), // Cyprus @@ -128,6 +129,7 @@ public class IBANValidator { new Validator("IL", 23, "IL\\d{21}" ), // Israel new Validator("IS", 26, "IS\\d{24}" ), // Iceland new Validator("IT", 27, "IT\\d{2}[A-Z]{1}\\d{10}[A-Z0-9]{12}" ), // Italy +new Validator("IQ", 23, "IQ\\d{2}[A-Z]{4}\\d{15}" ), // Iraq new Validator("JO", 30, "JO\\d{2}[A-Z]{4}\\d{4}[A-Z0-9]{18}"), // Jordan new Validator("KW", 30, "KW\\d{2}[A-Z]{4}[A-Z0-9]{22}" ), // Kuwait new Validator("KZ", 20, "KZ\\d{5}[A-Z0-9]{13}" ), // Kazakhstan Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java?rev=1781595&r1=1781594&r2=1781595&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java Fri Feb 3 20:34:32 2017 @@ -45,6 +45,7 @@ public class IBANValidatorTest { "BH67BMAG1299123456", "BR18141455123924100C2", "BR970036030510009795493P1", +// TODO add BY valid example "CH9300762011623852957", "CR05015202001026284066", "CY1700200128001200527600", @@ -69,6 +70,7 @@ public class IBANValidatorTest { "HU42117730161018", "IE29AIBK93115212345678", "IL620108000", +"IQ98NBIQ850123456789012", "IS140159260076545510730339", "IT60X054281110100123456", "JO94CBJO00100131000302", @@ -122,6 +124,7 @@ public class IBANValidatorTest { "QA58DOHB1234567890abcdefg", // lowercase version "RO491b3100759384", // lowercase version "LC62HEMM000100010012001200023015", // wrong in SWIFT +"BY00NBRB36000Z00AB00", // Wrong in SWIFT v73 }; private static final IBANValidator VALIDATOR = IBANValidator.getInstance();
svn commit: r1781596 - /commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java
Author: sebb Date: Fri Feb 3 20:55:22 2017 New Revision: 1781596 URL: http://svn.apache.org/viewvc?rev=1781596&view=rev Log: Add some more samples from thw SWIFT doc Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java?rev=1781596&r1=1781595&r2=1781596&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/IBANValidatorTest.java Fri Feb 3 20:55:22 2017 @@ -44,6 +44,7 @@ public class IBANValidatorTest { "BG80BNBG96611020345678", "BH67BMAG1299123456", "BR18141455123924100C2", +"BR180036030510009795493C1", "BR970036030510009795493P1", // TODO add BY valid example "CH9300762011623852957", @@ -102,12 +103,14 @@ public class IBANValidatorTest { "SC18SSCB11011497USD", "SE45558398257466", "SI5619100123438", +"SI56263300012039086", "SK311200198742637541", "SM86U03225098270100", "ST68000100010051845310112", "TL380080012345678910157", "TN5910006035183598478831", "TR330006100519786457841326", +"UA21322313026007233566001", "UA21399622026007233566001", "VG96VPVG012345678901", "XK051212012345678906", @@ -125,6 +128,8 @@ public class IBANValidatorTest { "RO491b3100759384", // lowercase version "LC62HEMM000100010012001200023015", // wrong in SWIFT "BY00NBRB36000Z00AB00", // Wrong in SWIFT v73 +"ST68000200010192194210112", // ditto +"SV62CENR0700025", // ditto }; private static final IBANValidator VALIDATOR = IBANValidator.getInstance();
svn commit: r1781661 - /commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
Author: sebb Date: Sat Feb 4 12:09:56 2017 New Revision: 1781661 URL: http://svn.apache.org/viewvc?rev=1781661&view=rev Log: Use https since it's available Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java?rev=1781661&r1=1781660&r2=1781661&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java Sat Feb 4 12:09:56 2017 @@ -396,11 +396,11 @@ public class DomainValidatorTest extends Set ianaTlds = new HashSet(); // keep for comparison with array contents DomainValidator dv = DomainValidator.getInstance(); File txtFile = new File("target/tlds-alpha-by-domain.txt"); -long timestamp = download(txtFile, "http://data.iana.org/TLD/tlds-alpha-by-domain.txt";, 0L); +long timestamp = download(txtFile, "https://data.iana.org/TLD/tlds-alpha-by-domain.txt";, 0L); final File htmlFile = new File("target/tlds-alpha-by-domain.html"); // N.B. sometimes the html file may be updated a day or so after the txt file // if the txt file contains entries not found in the html file, try again in a day or two -download(htmlFile,"http://www.iana.org/domains/root/db";, timestamp); +download(htmlFile,"https://www.iana.org/domains/root/db";, timestamp); BufferedReader br = new BufferedReader(new FileReader(txtFile)); String line;
svn commit: r1781663 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java
Author: sebb Date: Sat Feb 4 12:25:03 2017 New Revision: 1781663 URL: http://svn.apache.org/viewvc?rev=1781663&view=rev Log: Updated to Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java?rev=1781663&r1=1781662&r2=1781663&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java Sat Feb 4 12:25:03 2017 @@ -283,7 +283,7 @@ public class DomainValidator implements // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search private static final String[] GENERIC_TLDS = new String[] { -// Taken from Version 2016082201, Last Updated Tue Aug 23 07:07:02 2016 UTC + // Taken from Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC "aaa", // aaa American Automobile Association, Inc. "aarp", // aarp AARP "abarth", // abarth Fiat Chrysler Automobiles N.V. @@ -335,6 +335,7 @@ public class DomainValidator implements "android", // android Charleston Road Registry Inc. "anquan", // anquan QIHOO 360 TECHNOLOGY CO. LTD. "anz", // anz Australia and New Zealand Banking Group Limited +"aol", // aol AOL Inc. "apartments", // apartments June Maple, LLC "app", // app Charleston Road Registry Inc. "apple", // apple Apple Inc. @@ -373,6 +374,8 @@ public class DomainValidator implements "barclays", // barclays Barclays Bank PLC "barefoot", // barefoot Gallo Vineyards, Inc. "bargains", // bargains Half Hallow, LLC +"baseball", // baseball MLB Advanced Media DH, LLC +"basketball", // basketball Fédération Internationale de Basketball (FIBA) "bauhaus", // bauhaus Werkhaus GmbH "bayern", // bayern Bayern Connect GmbH "bbc", // bbc British Broadcasting Corporation @@ -418,8 +421,10 @@ public class DomainValidator implements "boots", // boots THE BOOTS COMPANY PLC "bosch", // bosch Robert Bosch GMBH "bostik", // bostik Bostik SA +"boston", // boston Boston TLD Management, LLC "bot", // bot Amazon Registry Services, Inc. "boutique", // boutique Over Galley, LLC +"box", // box NS1 Limited "bradesco", // bradesco Banco Bradesco S.A. "bridgestone", // bridgestone Bridgestone Corporation "broadway", // broadway Celebrate Broadway, Inc. @@ -456,10 +461,13 @@ public class DomainValidator implements "cars", // cars Uniregistry, Corp. "cartier", // cartier Richemont DNS Inc. "casa", // casa Top Level Domain Holdings Limited +"case", // case CNH Industrial N.V. +"caseih", // caseih CNH Industrial N.V. "cash", // cash Delta Lake, LLC "casino", // casino Binky Sky, LLC "cat", // cat Fundacio puntCAT "catering", // catering New Falls. LLC +"catholic", // catholic Pontificium Consilium de Comunicationibus Socialibus (PCCS) (Pontifical Council for Social Communication) "cba", // cba COMMONWEALTH BANK OF AUSTRALIA "cbn", // cbn The Christian Broadcasting Network, Inc. "cbre", // cbre CBRE, Inc. @@ -531,6 +539,7 @@ public class DomainValidator implements "cricket", // cricket dot Cricket Limited "crown", // crown Crown Equipment Corporation "crs", // crs Federated Co-operatives Limited +"cruise", // cruise Viking River Cruises (Bermuda) Ltd. "cruises", // cruises Spring Way, LLC "csc", // csc Alliance-One Services, Inc. "cuisinella", // cuisinella SALM S.A.S. @@ -539,6 +548,7 @@ public class DomainValidator implements "dabur", // dabur Dabur India Limited "dad", // dad Charleston Road Registry Inc. "dance", // dance United TLD Holdco Ltd. +"data", // d
svn commit: r1781665 - /commons/proper/validator/trunk/src/changes/changes.xml
Author: sebb Date: Sat Feb 4 13:13:00 2017 New Revision: 1781665 URL: http://svn.apache.org/viewvc?rev=1781665&view=rev Log: Recent changes Modified: commons/proper/validator/trunk/src/changes/changes.xml Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1781665&r1=1781664&r2=1781665&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Sat Feb 4 13:13:00 2017 @@ -64,7 +64,38 @@ The type attribute can be add,u --> - + http://commons.apache.org/validator/dependencies.html + "> + +IANA TLD lists: Updated to Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC + + +Update to version 73 of SWIFT IBAN list: added BY (Belarus) and IQ (Iraq); fixed Santa Lucia format + Generic .shop top level domain is considered invalid
svn commit: r1781666 - /commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java
Author: sebb Date: Sat Feb 4 13:15:35 2017 New Revision: 1781666 URL: http://svn.apache.org/viewvc?rev=1781666&view=rev Log: Add test to show how to fix VALIDATOR-412 Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java?rev=1781666&r1=1781665&r2=1781666&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java Sat Feb 4 13:15:35 2017 @@ -368,6 +368,18 @@ public class DomainValidatorTest extends assertTrue(validator.isValidGenericTld("com")); } +public void testVALIDATOR_412() { +assertFalse(validator.isValidGenericTld("local")); +assertFalse(validator.isValid("abc.local")); +assertFalse(validator.isValidGenericTld("pvt")); +assertFalse(validator.isValid("abc.pvt")); +DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"local", "pvt"}); +assertTrue(validator.isValidGenericTld("local")); +assertTrue(validator.isValid("abc.local")); +assertTrue(validator.isValidGenericTld("pvt")); +assertTrue(validator.isValid("abc.pvt")); +} + public void testCannotUpdate() { DomainValidator.updateTLDOverride(ArrayType.GENERIC_PLUS, new String[]{"ch"}); // OK DomainValidator dv = DomainValidator.getInstance();
svn commit: r1781670 - in /commons/proper/validator/trunk/src: changes/changes.xml main/java/org/apache/commons/validator/routines/UrlValidator.java test/java/org/apache/commons/validator/routines/Url
Author: sebb Date: Sat Feb 4 14:01:24 2017 New Revision: 1781670 URL: http://svn.apache.org/viewvc?rev=1781670&view=rev Log: VALIDATOR-411 UrlValidator accepts ports above max limit of 16-bit unsigned integer Modified: commons/proper/validator/trunk/src/changes/changes.xml commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1781670&r1=1781669&r2=1781670&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Sat Feb 4 14:01:24 2017 @@ -90,6 +90,9 @@ The dependencies for Validator have not For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html "> + +UrlValidator accepts ports above max limit of 16-bit unsigned integer + IANA TLD lists: Updated to Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1781670&r1=1781669&r2=1781670&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Sat Feb 4 14:01:24 2017 @@ -156,8 +156,7 @@ public class UrlValidator implements Ser private static final int PARSE_AUTHORITY_HOST_IP = 2; // excludes userinfo, if present -// Not needed, because it is validated by AUTHORITY_REGEX -//private static final int PARSE_AUTHORITY_PORT = 3; +private static final int PARSE_AUTHORITY_PORT = 3; // excludes leading colon /** * Should always be empty. The code currently allows spaces. @@ -413,6 +412,17 @@ public class UrlValidator implements Ser return false; } } +String port = authorityMatcher.group(PARSE_AUTHORITY_PORT); +if (port != null && port.length() > 0) { + try { + long iPort = Integer.parseInt(port); + if (iPort < 0 || iPort > 0x) { + return false; + } + } catch (NumberFormatException nfe) { + return false; // this can happen for big numbers + } +} } String extra = authorityMatcher.group(PARSE_AUTHORITY_EXTRA); Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java?rev=1781670&r1=1781669&r2=1781670&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Sat Feb 4 14:01:24 2017 @@ -322,6 +322,15 @@ protected void setUp() { assertTrue(urlValidator.isValid("http://example.rocks";)); } +public void testValidator411(){ +UrlValidator urlValidator = new UrlValidator(); +assertTrue(urlValidator.isValid("http://example.rocks:/";)); +assertTrue(urlValidator.isValid("http://example.rocks:0/";)); +assertTrue(urlValidator.isValid("http://example.rocks:65535/";)); +assertFalse(urlValidator.isValid("http://example.rocks:65536/";)); +assertFalse(urlValidator.isValid("http://example.rocks:10/";)); +} + static boolean incrementTestPartsIndex(int[] testPartsIndex, Object[] testParts) { boolean carry = true; //add 1 to lowest order part. boolean maxIndex = true; @@ -533,11 +542,12 @@ protected void setUp() { new ResultPair("", false) }; ResultPair[] testUrlPort = {new ResultPair(":80", true), - new ResultPair(":65535", true), + new ResultPair(":65535", true), // max possible
svn commit: r1781671 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Author: sebb Date: Sat Feb 4 14:19:48 2017 New Revision: 1781671 URL: http://svn.apache.org/viewvc?rev=1781671&view=rev Log: VALIDATOR-411 UrlValidator accepts ports above max limit of 16-bit unsigned integer - oops left off change Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1781671&r1=1781670&r2=1781671&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Sat Feb 4 14:19:48 2017 @@ -148,8 +148,8 @@ public class UrlValidator implements Ser USERINFO_CHARS_REGEX + "+:" + // At least one character for the name USERINFO_CHARS_REGEX + "*@"; // password may be absent private static final String AUTHORITY_REGEX = -"(?:\\[("+IPV6_REGEX+")\\]|(?:(?:"+USERINFO_FIELD_REGEX+")?([" + AUTHORITY_CHARS_REGEX + "]*)))(:\\d*)?(.*)?"; -// 1 e.g. user:pass@ 2 3 4 +"(?:\\[("+IPV6_REGEX+")\\]|(?:(?:"+USERINFO_FIELD_REGEX+")?([" + AUTHORITY_CHARS_REGEX + "]*)))(?::(\\d*))?(.*)?"; +// 1 e.g. user:pass@ 2 3 4 private static final Pattern AUTHORITY_PATTERN = Pattern.compile(AUTHORITY_REGEX); private static final int PARSE_AUTHORITY_IPV6 = 1;
svn commit: r1781672 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Author: sebb Date: Sat Feb 4 14:22:22 2017 New Revision: 1781672 URL: http://svn.apache.org/viewvc?rev=1781672&view=rev Log: VALIDATOR-411 - decided to use parseInt instead of Long and forgot to change variable Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1781672&r1=1781671&r2=1781672&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Sat Feb 4 14:22:22 2017 @@ -415,7 +415,7 @@ public class UrlValidator implements Ser String port = authorityMatcher.group(PARSE_AUTHORITY_PORT); if (port != null && port.length() > 0) { try { - long iPort = Integer.parseInt(port); + int iPort = Integer.parseInt(port); if (iPort < 0 || iPort > 0x) { return false; }
svn commit: r1781676 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java
Author: sebb Date: Sat Feb 4 14:49:00 2017 New Revision: 1781676 URL: http://svn.apache.org/viewvc?rev=1781676&view=rev Log: Use constant instead of magic number Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1781676&r1=1781675&r2=1781676&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Sat Feb 4 14:49:00 2017 @@ -78,6 +78,8 @@ public class UrlValidator implements Ser private static final long serialVersionUID = 7557161713937335013L; +private static final int MAX_UNSIGNED_16_BIT_INT = 0x; // port max + /** * Allows all validly formatted schemes to pass validation instead of * supplying a set of valid schemes. @@ -416,7 +418,7 @@ public class UrlValidator implements Ser if (port != null && port.length() > 0) { try { int iPort = Integer.parseInt(port); - if (iPort < 0 || iPort > 0x) { + if (iPort < 0 || iPort > MAX_UNSIGNED_16_BIT_INT) { return false; } } catch (NumberFormatException nfe) {
svn commit: r1781677 - /commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java
Author: sebb Date: Sat Feb 4 14:49:45 2017 New Revision: 1781677 URL: http://svn.apache.org/viewvc?rev=1781677&view=rev Log: Also test max+1 Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java?rev=1781677&r1=1781676&r2=1781677&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Sat Feb 4 14:49:45 2017 @@ -543,6 +543,7 @@ protected void setUp() { }; ResultPair[] testUrlPort = {new ResultPair(":80", true), new ResultPair(":65535", true), // max possible + new ResultPair(":65536", false), // max possible +1 new ResultPair(":0", true), new ResultPair("", true), new ResultPair(":-1", false),
svn commit: r1781780 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
Author: sebb Date: Sun Feb 5 16:34:46 2017 New Revision: 1781780 URL: http://svn.apache.org/viewvc?rev=1781780&view=rev Log: Document the number ranges Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=1781780&r1=1781779&r2=1781780&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Sun Feb 5 16:34:46 2017 @@ -121,19 +121,38 @@ public class CreditCardValidator impleme */ private static final CheckDigit LUHN_VALIDATOR = LuhnCheckDigit.LUHN_CHECK_DIGIT; -/** American Express (Amex) Card Validator */ +/** + * American Express (Amex) Card Validator + * 34 (15) + * 37 (15) + */ public static final CodeValidator AMEX_VALIDATOR = new CodeValidator("^(3[47]\\d{13})$", LUHN_VALIDATOR); -/** Diners Card Validator */ +/** + * Diners Card Validator + * 300xxx - 305xxx (14) + * 3095xx (14) + * 36 (14) + * 38 (14) + * 39 (14) + */ public static final CodeValidator DINERS_VALIDATOR = new CodeValidator("^(30[0-5]\\d{11}|3095\\d{10}|36\\d{12}|3[8-9]\\d{12})$", LUHN_VALIDATOR); -/** Discover Card regular expressions */ +/** + * Discover Card regular expressions + * 6011xx (16) + * 644xxx - 65 (16) + */ private static final RegexValidator DISCOVER_REGEX = new RegexValidator(new String[] {"^(6011\\d{12})$", "^(64[4-9]\\d{13})$", "^(65\\d{14})$"}); /** Discover Card Validator */ public static final CodeValidator DISCOVER_VALIDATOR = new CodeValidator(DISCOVER_REGEX, LUHN_VALIDATOR); -/** Mastercard regular expressions */ +/** + * Mastercard regular expressions + * 2221xx - 2720xx (16) + * 51xxx - 55xxx (16) + */ private static final RegexValidator MASTERCARD_REGEX = new RegexValidator( new String[] { "^(5[1-5]\\d{14})$", // 51 - 55 (pre Oct 2016) @@ -156,10 +175,14 @@ public class CreditCardValidator impleme @Deprecated public static final CodeValidator MASTERCARD_VALIDATOR_PRE_OCT2016 = new CodeValidator("^(5[1-5]\\d{14})$", LUHN_VALIDATOR); -/** Visa Card Validator */ +/** + * Visa Card Validator + * 4x (13 or 16) + */ public static final CodeValidator VISA_VALIDATOR = new CodeValidator("^(4)(\\d{12}|\\d{15})$", LUHN_VALIDATOR); -/** VPay (Visa) Card Validator +/** VPay (Visa) Card Validator + * 4x (13-19) * @since 1.5.0 */ public static final CodeValidator VPAY_VALIDATOR = new CodeValidator("^(4)(\\d{12,18})$", LUHN_VALIDATOR);
svn commit: r1781786 - /commons/proper/validator/trunk/src/changes/changes.xml
Author: sebb Date: Sun Feb 5 17:54:39 2017 New Revision: 1781786 URL: http://svn.apache.org/viewvc?rev=1781786&view=rev Log: VALIDATOR-394 - General Modulus Ten Check Digit Implementation Modified: commons/proper/validator/trunk/src/changes/changes.xml Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1781786&r1=1781785&r2=1781786&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Sun Feb 5 17:54:39 2017 @@ -90,6 +90,9 @@ The dependencies for Validator have not For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html "> +> +General Modulus Ten Check Digit Implementation + UrlValidator accepts ports above max limit of 16-bit unsigned integer
svn commit: r1781788 - in /commons/proper/validator/trunk/src: changes/changes.xml main/java/org/apache/commons/validator/routines/UrlValidator.java test/java/org/apache/commons/validator/routines/Url
Author: sebb Date: Sun Feb 5 18:35:00 2017 New Revision: 1781788 URL: http://svn.apache.org/viewvc?rev=1781788&view=rev Log: VALIDATOR-387 Userinfo without colon should be valid in UrlValidator Modified: commons/proper/validator/trunk/src/changes/changes.xml commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1781788&r1=1781787&r2=1781788&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Sun Feb 5 18:35:00 2017 @@ -90,7 +90,10 @@ The dependencies for Validator have not For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html "> -> +> +Userinfo without colon should be valid in UrlValidator + +> General Modulus Ten Check Digit Implementation Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1781788&r1=1781787&r2=1781788&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Sun Feb 5 18:35:00 2017 @@ -147,8 +147,8 @@ public class UrlValidator implements Ser private static final String USERINFO_CHARS_REGEX = "[a-zA-Z0-9%-._~!$&'()*+,;=]"; // since neither ':' nor '@' are allowed chars, we don't need to use non-greedy matching private static final String USERINFO_FIELD_REGEX = -USERINFO_CHARS_REGEX + "+:" + // At least one character for the name -USERINFO_CHARS_REGEX + "*@"; // password may be absent +USERINFO_CHARS_REGEX + "+" + // At least one character for the name +"(?::" + USERINFO_CHARS_REGEX + "*)?@"; // colon and password may be absent private static final String AUTHORITY_REGEX = "(?:\\[("+IPV6_REGEX+")\\]|(?:(?:"+USERINFO_FIELD_REGEX+")?([" + AUTHORITY_CHARS_REGEX + "]*)))(?::(\\d*))?(.*)?"; // 1 e.g. user:pass@ 2 3 4 Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java?rev=1781788&r1=1781787&r2=1781788&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Sun Feb 5 18:35:00 2017 @@ -471,6 +471,7 @@ protected void setUp() { assertTrue(validator.isValid("http://www.apache.org:80/path";)); assertTrue(validator.isValid("http://user:p...@www.apache.org:80/path";)); assertTrue(validator.isValid("http://user:@www.apache.org:80/path";)); + assertTrue(validator.isValid("http://u...@www.apache.org:80/path";)); assertTrue(validator.isValid("http://us%00er:-._~!$&;'()*+,;=@www.apache.org:80/path")); assertFalse(validator.isValid("http://:p...@www.apache.org:80/path";)); assertFalse(validator.isValid("http://:@www.apache.org:80/path";));
svn commit: r1781789 - in /commons/proper/validator/trunk/src: changes/changes.xml main/java/org/apache/commons/validator/routines/CodeValidator.java
Author: sebb Date: Sun Feb 5 18:46:45 2017 New Revision: 1781789 URL: http://svn.apache.org/viewvc?rev=1781789&view=rev Log: VALIDATOR-379 CodeValidator unconditionally trim()s the input string Modified: commons/proper/validator/trunk/src/changes/changes.xml commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1781789&r1=1781788&r2=1781789&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Sun Feb 5 18:46:45 2017 @@ -90,6 +90,9 @@ The dependencies for Validator have not For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html "> + +CodeValidator unconditionally trim()s the input string - document the behaviour + > Userinfo without colon should be valid in UrlValidator Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java?rev=1781789&r1=1781788&r2=1781789&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CodeValidator.java Sun Feb 5 18:46:45 2017 @@ -218,6 +218,13 @@ public final class CodeValidator impleme /** * Validate the code returning either true * or false. + * + * This calls {@link #validate(String)} and returns false + * if the return value is null, true otherwise. + * + * Note that {@link #validate(String)} trims the input + * and if there is a {@link RegexValidator} it may also + * change the input as part of the validation. * * @param input The code to validate * @return true if valid, otherwise @@ -230,6 +237,10 @@ public final class CodeValidator impleme /** * Validate the code returning either the valid code or * null if invalid. + * + * Note that this method trims the input + * and if there is a {@link RegexValidator} it may also + * change the input as part of the validation. * * @param input The code to validate * @return The code if valid, otherwise null
svn commit: r1781790 - /commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java
Author: sebb Date: Sun Feb 5 19:03:59 2017 New Revision: 1781790 URL: http://svn.apache.org/viewvc?rev=1781790&view=rev Log: Not useful Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java?rev=1781790&r1=1781789&r2=1781790&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Sun Feb 5 19:03:59 2017 @@ -491,17 +491,6 @@ protected void setUp() { assertTrue(validator.isValid("http://www.apache.org:/path";)); } - /** -* Only used to debug the unit tests. -* @param argv -*/ - public static void main(String[] argv) { - - UrlValidatorTest fct = new UrlValidatorTest("url test"); - fct.setUp(); - fct.testIsValid(); - fct.testIsValidScheme(); - } // Test data for creating a composite URL /** * The data given below approximates the 4 parts of a URL
svn commit: r1781798 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
Author: sebb Date: Sun Feb 5 20:31:39 2017 New Revision: 1781798 URL: http://svn.apache.org/viewvc?rev=1781798&view=rev Log: Improve Javadoc layout Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=1781798&r1=1781797&r2=1781798&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Sun Feb 5 20:31:39 2017 @@ -123,25 +123,28 @@ public class CreditCardValidator impleme /** * American Express (Amex) Card Validator - * 34 (15) - * 37 (15) + * + * 34 (15) + * 37 (15) */ public static final CodeValidator AMEX_VALIDATOR = new CodeValidator("^(3[47]\\d{13})$", LUHN_VALIDATOR); /** * Diners Card Validator - * 300xxx - 305xxx (14) - * 3095xx (14) - * 36 (14) - * 38 (14) - * 39 (14) + * + * 300xxx - 305xxx (14) + * 3095xx (14) + * 36 (14) + * 38 (14) + * 39 (14) */ public static final CodeValidator DINERS_VALIDATOR = new CodeValidator("^(30[0-5]\\d{11}|3095\\d{10}|36\\d{12}|3[8-9]\\d{12})$", LUHN_VALIDATOR); /** * Discover Card regular expressions - * 6011xx (16) - * 644xxx - 65 (16) + * + * 6011xx (16) + * 644xxx - 65 (16) */ private static final RegexValidator DISCOVER_REGEX = new RegexValidator(new String[] {"^(6011\\d{12})$", "^(64[4-9]\\d{13})$", "^(65\\d{14})$"}); @@ -150,8 +153,9 @@ public class CreditCardValidator impleme /** * Mastercard regular expressions - * 2221xx - 2720xx (16) - * 51xxx - 55xxx (16) + * + * 2221xx - 2720xx (16) + * 51xxx - 55xxx (16) */ private static final RegexValidator MASTERCARD_REGEX = new RegexValidator( new String[] { @@ -177,11 +181,13 @@ public class CreditCardValidator impleme /** * Visa Card Validator + * * 4x (13 or 16) */ public static final CodeValidator VISA_VALIDATOR = new CodeValidator("^(4)(\\d{12}|\\d{15})$", LUHN_VALIDATOR); /** VPay (Visa) Card Validator + * * 4x (13-19) * @since 1.5.0 */
svn commit: r1781815 - in /commons/proper/validator/trunk/src: changes/changes.xml main/java/org/apache/commons/validator/routines/CreditCardValidator.java test/java/org/apache/commons/validator/routi
Author: sebb Date: Sun Feb 5 21:58:38 2017 New Revision: 1781815 URL: http://svn.apache.org/viewvc?rev=1781815&view=rev Log: VALIDATOR-413 Generic CreditCard validation Modified: commons/proper/validator/trunk/src/changes/changes.xml commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1781815&r1=1781814&r2=1781815&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Sun Feb 5 21:58:38 2017 @@ -90,6 +90,9 @@ The dependencies for Validator have not For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html "> + +Generic CreditCard validation + CodeValidator unconditionally trim()s the input string - document the behaviour Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=1781815&r1=1781814&r2=1781815&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Sun Feb 5 21:58:38 2017 @@ -57,6 +57,10 @@ public class CreditCardValidator impleme private static final long serialVersionUID = 5955978921148959496L; +private static final int MIN_CC_LENGTH = 12; // minimum allowed length + + private static final int MAX_CC_LENGTH = 19; // maximum allowed length + /** * Option specifying that no cards are allowed. This is useful if * you want only custom card types to validate so you turn off the @@ -252,6 +256,36 @@ public class CreditCardValidator impleme } /** + * Create a new generic CreditCardValidator which validates the syntax and check digit only. + * @param minLen minimum allowed length + * @param maxLen maximum allowed length + * @return the validator + * @since 1.5.2 + */ +public static CreditCardValidator genericCreditCardValidator(int minLen, int maxLen) { + return new CreditCardValidator(new CodeValidator[] {new CodeValidator("(\\d+)", minLen, maxLen, LuhnCheckDigit.LUHN_CHECK_DIGIT)}); +} + +/** + * Create a new generic CreditCardValidator which validates the syntax and check digit only. + * @param length exact length + * @return the validator + * @since 1.5.2 + */ +public static CreditCardValidator genericCreditCardValidator(int length) { + return genericCreditCardValidator(length, length); +} + +/** + * Create a new generic CreditCardValidator which validates the syntax and check digit only. + * @return the validator + * @since 1.5.2 + */ +public static CreditCardValidator genericCreditCardValidator() { + return genericCreditCardValidator(MIN_CC_LENGTH, MAX_CC_LENGTH); +} + +/** * Checks if the field is a valid credit card number. * @param card The card number to validate. * @return Whether the card number is valid. Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java?rev=1781815&r1=1781814&r2=1781815&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java Sun Feb 5 21:58:38 2017 @@ -44,6 +44,34 @@ public class CreditCardValidatorTest ext private static final String VALID_VPAY2 = "43700012"; private static final String ERROR_VPAY = "43700069"; +private static final String [] VALID_CARDS = { + VALID_VISA, + VALID_SHORT_VISA, + VALID_AMEX, + VALID_MASTERCARD, + VALID_DISCOVER, + VALID_DISCOVER65, + VALID_DINERS, + VALID_VPAY, +
svn commit: r1781829 - in /commons/proper/validator/trunk/src: main/java/org/apache/commons/validator/routines/ test/java/org/apache/commons/validator/routines/
Author: sebb Date: Sun Feb 5 23:04:24 2017 New Revision: 1781829 URL: http://svn.apache.org/viewvc?rev=1781829&view=rev Log: Tab police Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/DomainValidatorTest.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=1781829&r1=1781828&r2=1781829&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Sun Feb 5 23:04:24 2017 @@ -59,7 +59,7 @@ public class CreditCardValidator impleme private static final int MIN_CC_LENGTH = 12; // minimum allowed length - private static final int MAX_CC_LENGTH = 19; // maximum allowed length +private static final int MAX_CC_LENGTH = 19; // maximum allowed length /** * Option specifying that no cards are allowed. This is useful if @@ -263,7 +263,7 @@ public class CreditCardValidator impleme * @since 1.5.2 */ public static CreditCardValidator genericCreditCardValidator(int minLen, int maxLen) { - return new CreditCardValidator(new CodeValidator[] {new CodeValidator("(\\d+)", minLen, maxLen, LuhnCheckDigit.LUHN_CHECK_DIGIT)}); +return new CreditCardValidator(new CodeValidator[] {new CodeValidator("(\\d+)", minLen, maxLen, LuhnCheckDigit.LUHN_CHECK_DIGIT)}); } /** @@ -273,7 +273,7 @@ public class CreditCardValidator impleme * @since 1.5.2 */ public static CreditCardValidator genericCreditCardValidator(int length) { - return genericCreditCardValidator(length, length); +return genericCreditCardValidator(length, length); } /** @@ -282,7 +282,7 @@ public class CreditCardValidator impleme * @since 1.5.2 */ public static CreditCardValidator genericCreditCardValidator() { - return genericCreditCardValidator(MIN_CC_LENGTH, MAX_CC_LENGTH); +return genericCreditCardValidator(MIN_CC_LENGTH, MAX_CC_LENGTH); } /** Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java?rev=1781829&r1=1781828&r2=1781829&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/DomainValidator.java Sun Feb 5 23:04:24 2017 @@ -283,7 +283,7 @@ public class DomainValidator implements // WARNING: this array MUST be sorted, otherwise it cannot be searched reliably using binary search private static final String[] GENERIC_TLDS = new String[] { - // Taken from Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC +// Taken from Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC "aaa", // aaa American Automobile Association, Inc. "aarp", // aarp AARP "abarth", // abarth Fiat Chrysler Automobiles N.V. Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1781829&r1=1781828&r2=1781829&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Sun Feb 5 23:04:24 2017 @@ -416,14 +416,14 @@ public class UrlValidator implements Ser } String port = authorityMatcher.group(PARSE_AUTHORITY_PORT); if (port != null && port.length() > 0) { - tr
svn commit: r1781925 - in /commons/proper/net/trunk/src: changes/ main/java/org/apache/commons/net/ftp/parser/ test/java/org/apache/commons/net/ftp/parser/
Author: sebb Date: Mon Feb 6 16:43:40 2017 New Revision: 1781925 URL: http://svn.apache.org/viewvc?rev=1781925&view=rev Log: NET-609 - DefaultUnixFTPFileEntryParserFactory Issue (leading spaces removal configuration) Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1781925&r1=1781924&r2=1781925&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Mon Feb 6 16:43:40 2017 @@ -64,6 +64,9 @@ The type attribute can be add,u + +DefaultUnixFTPFileEntryParserFactory Issue (leading spaces removal configuration) + POP3Mail example: support host port; allow reading password from Console/stdin/environment Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java?rev=1781925&r1=1781924&r2=1781925&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java Mon Feb 6 16:43:40 2017 @@ -121,13 +121,14 @@ public class DefaultFTPFileEntryParserFa if (parser == null) { // Now try for aliases String ukey = key.toUpperCase(java.util.Locale.ENGLISH); -if (ukey.indexOf(FTPClientConfig.SYST_UNIX) >= 0) +if (ukey.indexOf(FTPClientConfig.SYST_UNIX_TRIM_LEADING) >= 0) { -parser = new UnixFTPEntryParser(config, false); +parser = new UnixFTPEntryParser(config, true); } -else if (ukey.indexOf(FTPClientConfig.SYST_UNIX_TRIM_LEADING) >= 0) +// must check this after SYST_UNIX_TRIM_LEADING as it is a substring of it +else if (ukey.indexOf(FTPClientConfig.SYST_UNIX) >= 0) { -parser = new UnixFTPEntryParser(config, true); +parser = new UnixFTPEntryParser(config, false); } else if (ukey.indexOf(FTPClientConfig.SYST_VMS) >= 0) { Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java?rev=1781925&r1=1781924&r2=1781925&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java Mon Feb 6 16:43:40 2017 @@ -148,7 +148,7 @@ public class UnixFTPEntryParser extends // if true, leading spaces are trimmed from file names // this was the case for the original implementation -private final boolean trimLeadingSpaces; +final boolean trimLeadingSpaces; // package protected for access from test code /** * The default constructor for a UnixFTPEntryParser object. Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java?rev=1781925&r1=1781924&r2=1781925&view=diff == --- commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java (original) +++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactoryTest.java Mon Feb 6 16:43:40 2017 @@ -32,6 +32,11 @@ public class DefaultFTPFileEntryParserFa parser = factory.createFileEntryParser("UNIX"); assertTrue(parser instanceof UnixFTPEntryParser); +assertFalse(((UnixFTPEntryParser)parser).trim
[text] Fix generics warnings; allows several casts to be dropped
Repository: commons-text Updated Branches: refs/heads/master d24d8b257 -> 72733aea2 Fix generics warnings; allows several casts to be dropped Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/72733aea Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/72733aea Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/72733aea Branch: refs/heads/master Commit: 72733aea2fa536d98804ee09358fa50ca9ce41a8 Parents: d24d8b2 Author: Sebb Authored: Tue Feb 7 10:57:17 2017 + Committer: Sebb Committed: Tue Feb 7 10:57:17 2017 + -- .../text/beta/translate/EntityArrays.java | 4 ++-- .../text/beta/translate/LookupTranslator.java | 11 +-- .../beta/translate/SingleLookupTranslator.java | 20 +--- .../beta/translate/SinglePassTranslator.java| 2 +- .../text/beta/translate/EntityArraysTest.java | 3 ++- 5 files changed, 19 insertions(+), 21 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-text/blob/72733aea/src/main/java/org/apache/commons/text/beta/translate/EntityArrays.java -- diff --git a/src/main/java/org/apache/commons/text/beta/translate/EntityArrays.java b/src/main/java/org/apache/commons/text/beta/translate/EntityArrays.java index 6c8a891..2db22f0 100644 --- a/src/main/java/org/apache/commons/text/beta/translate/EntityArrays.java +++ b/src/main/java/org/apache/commons/text/beta/translate/EntityArrays.java @@ -434,9 +434,9 @@ public class EntityArrays { */ public static Map invert(final Map map) { Map newMap = new HashMap<>(); -Iterator it = map.entrySet().iterator(); +Iterator> it = map.entrySet().iterator(); while (it.hasNext()) { -Map.Entry pair = (Map.Entry)it.next(); +Map.Entry pair = it.next(); newMap.put((CharSequence) pair.getValue(), (CharSequence) pair.getKey()); } return newMap; http://git-wip-us.apache.org/repos/asf/commons-text/blob/72733aea/src/main/java/org/apache/commons/text/beta/translate/LookupTranslator.java -- diff --git a/src/main/java/org/apache/commons/text/beta/translate/LookupTranslator.java b/src/main/java/org/apache/commons/text/beta/translate/LookupTranslator.java index 3e8bd0b..064ab27 100644 --- a/src/main/java/org/apache/commons/text/beta/translate/LookupTranslator.java +++ b/src/main/java/org/apache/commons/text/beta/translate/LookupTranslator.java @@ -55,14 +55,13 @@ public class LookupTranslator extends CharSequenceTranslator { prefixSet = new HashSet<>(); int _shortest = Integer.MAX_VALUE; int _longest = 0; -Iterator it = lookupMap.entrySet().iterator(); +Iterator> it = lookupMap.entrySet().iterator(); while (it.hasNext()) { -Map.Entry pair = (Map.Entry)it.next(); -this.lookupMap.put(((CharSequence) pair.getKey()).toString(), -((CharSequence) pair.getValue()).toString()); -this.prefixSet.add(((CharSequence) pair.getKey()).charAt(0)); -final int sz = ((CharSequence) pair.getKey()).length(); +Map.Entry pair = it.next(); +this.lookupMap.put(pair.getKey().toString(), pair.getValue().toString()); +this.prefixSet.add((pair.getKey()).charAt(0)); +final int sz = pair.getKey().length(); if (sz < _shortest) { _shortest = sz; } http://git-wip-us.apache.org/repos/asf/commons-text/blob/72733aea/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java -- diff --git a/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java b/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java index 744f701..b98cf57 100644 --- a/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java +++ b/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java @@ -56,11 +56,10 @@ public class SingleLookupTranslator extends CharSequenceTranslator { public SingleLookupTranslator(Map... inputMaps) { Map lookup = new HashMap<>(); for (Map input : inputMaps) { -Iterator it = input.entrySet().iterator(); +Iterator> it = input.entrySet().iterator(); while (it.hasNext()) { -Map.Entry pair = (Map.Entry) it.next(); -lookup.put((CharSequence) pair.getKey(), -(CharSequence) pair.getValue()); +Map.Entry pair = it.ne
[text] Once a String, alwaus a String ...
Repository: commons-text Updated Branches: refs/heads/master 72733aea2 -> 6c19c2cca Once a String, alwaus a String ... Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/6c19c2cc Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/6c19c2cc Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/6c19c2cc Branch: refs/heads/master Commit: 6c19c2cca0127ca9ed1323ccca8ece2240c28d11 Parents: 72733ae Author: Sebb Authored: Tue Feb 7 11:00:08 2017 + Committer: Sebb Committed: Tue Feb 7 11:00:08 2017 + -- .../apache/commons/text/beta/translate/SingleLookupTranslator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-text/blob/6c19c2cc/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java -- diff --git a/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java b/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java index b98cf57..ffb5489 100644 --- a/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java +++ b/src/main/java/org/apache/commons/text/beta/translate/SingleLookupTranslator.java @@ -72,7 +72,7 @@ public class SingleLookupTranslator extends CharSequenceTranslator { Iterator> it = lookup.entrySet().iterator(); while (it.hasNext()) { Map.Entry pair = it.next(); -this.lookupMap.put(pair.getKey().toString(), pair.getValue().toString().toString()); +this.lookupMap.put(pair.getKey().toString(), pair.getValue().toString()); this.prefixSet.add(pair.getKey().charAt(0)); final int sz = pair.getKey().length(); if (sz < _shortest) {
[text] Unused
Repository: commons-text Updated Branches: refs/heads/master 6c19c2cca -> 13e5051de Unused Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/13e5051d Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/13e5051d Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/13e5051d Branch: refs/heads/master Commit: 13e5051de1db3c8bd1a82127be165bb8bf03d27f Parents: 6c19c2c Author: Sebb Authored: Tue Feb 7 11:03:03 2017 + Committer: Sebb Committed: Tue Feb 7 11:03:03 2017 + -- .../apache/commons/text/beta/similarity/JaroWinklerDistance.java | 4 1 file changed, 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-text/blob/13e5051d/src/main/java/org/apache/commons/text/beta/similarity/JaroWinklerDistance.java -- diff --git a/src/main/java/org/apache/commons/text/beta/similarity/JaroWinklerDistance.java b/src/main/java/org/apache/commons/text/beta/similarity/JaroWinklerDistance.java index 6e81946..7d1718b 100644 --- a/src/main/java/org/apache/commons/text/beta/similarity/JaroWinklerDistance.java +++ b/src/main/java/org/apache/commons/text/beta/similarity/JaroWinklerDistance.java @@ -42,10 +42,6 @@ import java.util.Arrays; public class JaroWinklerDistance implements SimilarityScore { /** - * The default prefix length limit set to four. - */ -private static final int PREFIX_LENGTH_LIMIT = 4; -/** * Represents a failed index search. */ public static final int INDEX_NOT_FOUND = -1;
[text] Spelling
Repository: commons-text Updated Branches: refs/heads/master 13e5051de -> 7a96b5000 Spelling Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/7a96b500 Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/7a96b500 Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/7a96b500 Branch: refs/heads/master Commit: 7a96b500028a7b63dac49c0449b52454b75f0e59 Parents: 13e5051 Author: Sebb Authored: Tue Feb 7 11:22:19 2017 + Committer: Sebb Committed: Tue Feb 7 11:22:19 2017 + -- RELEASE-NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-text/blob/7a96b500/RELEASE-NOTES.txt -- diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 9dad4ee..56769a8 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -58,7 +58,7 @@ o TEXT-9:Incorporate String algorithms from Commons Lang Thanks to britter. FIXED BUGS == -Note. We recognize the curoisity of a new component having "fixed bugs," but a +Note. We recognize the curiosity of a new component having "fixed bugs," but a considerable number of files were migrated over from Commons Lang, some of which needed fixes.
svn commit: r1782001 - /commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java
Author: sebb Date: Tue Feb 7 14:39:59 2017 New Revision: 1782001 URL: http://svn.apache.org/viewvc?rev=1782001&view=rev Log: mdtmFile can return null Modified: commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java Modified: commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java?rev=1782001&r1=1782000&r2=1782001&view=diff == --- commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java (original) +++ commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java Tue Feb 7 14:39:59 2017 @@ -410,8 +410,12 @@ __main: } if (mdtm) { FTPFile f = ftp.mdtmFile(remote); -System.out.println(f.getRawListing()); -System.out.println(f.toFormattedString(displayTimeZoneId)); +if (f != null) { +System.out.println(f.getRawListing()); + System.out.println(f.toFormattedString(displayTimeZoneId)); +} else { +System.out.println("File not found"); +} } if (mlst) { FTPFile f = ftp.mlistFile(remote);
svn commit: r1782002 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTP.java
Author: sebb Date: Tue Feb 7 14:40:49 2017 New Revision: 1782002 URL: http://svn.apache.org/viewvc?rev=1782002&view=rev Log: NET-611 FTP does not validate command reply syntax fully Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782002&r1=1782001&r2=1782002&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Tue Feb 7 14:40:49 2017 @@ -63,7 +63,30 @@ The type attribute can be add,u --> - + + +FTP does not validate command reply syntax fully + DefaultUnixFTPFileEntryParserFactory Issue (leading spaces removal configuration) Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java?rev=1782002&r1=1782001&r2=1782002&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java Tue Feb 7 14:40:49 2017 @@ -236,6 +236,14 @@ public class FTP extends SocketClient protected boolean strictMultilineParsing = false; /** + * If this is true, then non-multiline replies must have the format: + * 3 digit code + * If false, then the 3 digit code does not have to be followed by space + * See section 4.2 of RFC 959 for details. + */ +private boolean strictReplyParsing = true; + +/** * Wraps SocketClient._input_ to facilitate the reading of text * from the FTP control connection. Do not access the control * connection via SocketClient._input_. This member starts @@ -339,25 +347,37 @@ public class FTP extends SocketClient _replyLines.add(line); -// Get extra lines if message continues. -if (length > REPLY_CODE_LEN && line.charAt(REPLY_CODE_LEN) == '-') -{ -do -{ -line = _controlInput_.readLine(); - -if (line == null) { -throw new FTPConnectionClosedException( -"Connection closed without indication."); +// Check the server reply type +if (length > REPLY_CODE_LEN) { +char sep = line.charAt(REPLY_CODE_LEN); +// Get extra lines if message continues. +if (sep == '-') { +do +{ +line = _controlInput_.readLine(); + +if (line == null) { +throw new FTPConnectionClosedException( +"Connection closed without indication."); +} + +_replyLines.add(line); + +// The length() check handles problems that could arise from readLine() +// returning too soon after encountering a naked CR or some other +// anomaly. } +while ( isStrictMultilineParsing() ? __strictCheck(line, code) : __lenientCheck(line)); -_replyLines.add(line); - -// The length() check handles problems that could arise from readLine() -// returning too soon after encountering a naked CR or some other -// anomaly. +} else if (isStrictReplyParsing()) { +if (length == REPLY_CODE_LEN + 1) { // expecting some text +throw new MalformedServerReplyException("Truncated server reply: '" + line +"'"); +} else if (sep != ' ') { +throw new MalformedServerReplyException("Invalid server reply: '" + line +"'"); +} } -while ( isStrictMultilineParsing() ? __strictCheck(line, code) : __lenientCheck(line)); +} else if (isStrictReplyParsing()) { +throw new MalformedServerReplyException("Truncated server reply: '" + line +"'"); } if (reportReply) { @@ -1803,6 +1823,36 @@ public class FTP extends SocketClient } /** + * Return whether strict non-multiline parsing is enabled, as per RFC 959, section 4.2. + * + * The default is true, which requires the 3 digit code be followed by space and some t
svn commit: r1782012 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPClient.java
Author: sebb Date: Tue Feb 7 15:33:35 2017 New Revision: 1782012 URL: http://svn.apache.org/viewvc?rev=1782012&view=rev Log: NET-610 FTPClient.mlistFile incorrectly handles MLST reply Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782012&r1=1782011&r2=1782012&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Tue Feb 7 15:33:35 2017 @@ -79,11 +79,17 @@ This is mainly a bug-fix release. See fu Note also that if strict checking is disabled, some functions may unconditionally strip the next character after the code, without checking it if is a space. + The FTP client mlistFile() method now checks for a leading space before removing it. + If the space is missing, a MalformedServerReplyException is thrown. + This will only happen if the FTP server is not compliant with RFC 3659. Notable additions: The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +FTPClient.mlistFile incorrectly handles MLST reply + FTP does not validate command reply syntax fully Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1782012&r1=1782011&r2=1782012&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Tue Feb 7 15:33:35 2017 @@ -2507,7 +2507,15 @@ implements Configurable { boolean success = FTPReply.isPositiveCompletion(sendCommand(FTPCmd.MLST, pathname)); if (success){ -String entry = getReplyStrings()[1].substring(1); // skip leading space for parser +String reply = getReplyStrings()[1]; +/* check the response makes sense. + * Must have space before fact(s) and between fact(s) and filename + * Fact(s) can be absent, so at least 3 chars are needed. + */ +if (reply.length() < 3 || reply.charAt(0) != ' ') { +throw new MalformedServerReplyException("Invalid server reply (MLST): '" + reply + "'"); +} +String entry = reply.substring(1); // skip leading space for parser return MLSxEntryParser.parseEntry(entry); } else { return null;
svn commit: r1782074 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPClient.java test/java/org/apache/commons/net/ftp/FTPClientTest.java
Author: sebb Date: Tue Feb 7 20:02:28 2017 New Revision: 1782074 URL: http://svn.apache.org/viewvc?rev=1782074&view=rev Log: NET-588 FTPClient.setPassiveNatWorkaround assumes host is outside site local range Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientTest.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782074&r1=1782073&r2=1782074&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Tue Feb 7 20:02:28 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +FTPClient.setPassiveNatWorkaround assumes host is outside site local range + FTPClient.mlistFile incorrectly handles MLST reply Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1782074&r1=1782073&r2=1782074&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Tue Feb 7 20:02:28 2017 @@ -406,9 +406,10 @@ implements Configurable private int __controlKeepAliveReplyTimeout=1000; /** - * Enable or disable replacement of internal IP in passive mode. Default enabled. + * Enable or disable replacement of internal IP in passive mode. Default enabled + * using {code NatServerResolverImpl}. */ -private boolean __passiveNatWorkaround = true; +private HostnameResolver __passiveNatWorkaroundStrategy = new NatServerResolverImpl(this); /** Pattern for PASV mode responses. Groups: (n,n,n,n),(n),(n) */ private static final java.util.regex.Pattern __PARMS_PAT; @@ -582,18 +583,13 @@ implements Configurable "Could not parse passive port information.\nServer Reply: " + reply); } -if (__passiveNatWorkaround) { +if (__passiveNatWorkaroundStrategy != null) { try { -InetAddress host = InetAddress.getByName(__passiveHost); -// reply is a local address, but target is not - assume NAT box changed the PASV reply -if (host.isSiteLocalAddress()) { -InetAddress remote = getRemoteAddress(); -if (!remote.isSiteLocalAddress()){ -String hostAddress = remote.getHostAddress(); -fireReplyReceived(0, -"[Replacing site local address "+__passiveHost+" with "+hostAddress+"]\n"); -__passiveHost = hostAddress; -} +String passiveHost = __passiveNatWorkaroundStrategy.resolve(__passiveHost); +if (!__passiveHost.equals(passiveHost)) { +fireReplyReceived(0, +"[Replacing PASV mode reply address "+__passiveHost+" with "+passiveHost+"]\n"); +__passiveHost = passiveHost; } } catch (UnknownHostException e) { // Should not happen as we are passing in an IP address throw new MalformedServerReplyException( @@ -3784,9 +3780,65 @@ implements Configurable * The default is true, i.e. site-local replies are replaced. * @param enabled true to enable replacing internal IP's in passive * mode. + * @deprecated use {@link #setPassiveNatWorkaroundStrategy(HostnameResolver)} instead */ +@Deprecated public void setPassiveNatWorkaround(boolean enabled) { -this.__passiveNatWorkaround = enabled; +if (enabled) { +this.__passiveNatWorkaroundStrategy = new NatServerResolverImpl(this); +} else { +this.__passiveNatWorkaroundStrategy = null; +} +} + +/** + * Set the workaround strategy to replace the PASV mode reply addresses. + * This gets around the problem that some NAT boxes may change the reply. + * + * The default implementation is {@code NatServerResolverImpl}, i.e. site-local + * replies are replaced. + * @param resolver strategy to replace internal IP's in passive mode +
svn commit: r1782077 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/tftp/TFTPClient.java
Author: sebb Date: Tue Feb 7 20:33:05 2017 New Revision: 1782077 URL: http://svn.apache.org/viewvc?rev=1782077&view=rev Log: NET-604 TFTP send & receive don't have progress indication Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782077&r1=1782076&r2=1782077&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Tue Feb 7 20:33:05 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +TFTP send & receive don't have progress indication + FTPClient.setPassiveNatWorkaround assumes host is outside site local range Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java?rev=1782077&r1=1782076&r2=1782077&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Tue Feb 7 20:33:05 2017 @@ -65,6 +65,12 @@ public class TFTPClient extends TFTP /*** The maximum number of timeouts allowed before failing. ***/ private int __maxTimeouts; +/*** The number of bytes received in the ongoing download. ***/ +private long totalBytesReceived = 0; + +/*** The number of bytes sent in the ongoing upload. ***/ +private long totalBytesSent = 0; + /*** * Creates a TFTPClient instance with a default timeout of DEFAULT_TIMEOUT, * maximum timeouts value of DEFAULT_MAX_TIMEOUTS, a null socket, @@ -106,6 +112,20 @@ public class TFTPClient extends TFTP } +/** + * @return The number of bytes received in the ongoing download + */ +public long getTotalBytesReceived() { +return totalBytesReceived; +} + +/** + * @return The number of bytes sent in the ongoing download + */ +public long getTotalBytesSent() { +return totalBytesSent; +} + /*** * Requests a named file from a remote host, writes the * file to an OutputStream, closes the connection, and returns the number @@ -135,6 +155,7 @@ public class TFTPClient extends TFTP beginBufferedOps(); dataLength = lastBlock = hostPort = bytesRead = 0; +totalBytesReceived = 0; block = 1; if (mode == TFTP.ASCII_MODE) { @@ -277,6 +298,7 @@ _receivePacket: ack.setBlockNumber(lastBlock); sent = ack; bytesRead += dataLength; +totalBytesReceived += dataLength; } // First data packet less than 512 bytes signals end of stream. while (dataLength == TFTPPacket.SEGMENT_SIZE); @@ -386,6 +408,7 @@ _receivePacket: beginBufferedOps(); dataLength = lastBlock = hostPort = bytesRead = totalThisPacket = 0; +totalBytesSent = 0L; block = 0; boolean lastAckWait = false; @@ -541,6 +564,7 @@ _receivePacket: data.setBlockNumber(block); data.setData(_sendBuffer, 4, totalThisPacket); sent = data; +totalBytesSent += totalThisPacket; } while ( totalThisPacket > 0 || lastAckWait ); // Note: this was looping while dataLength == 0 || lastAckWait,
svn commit: r1782089 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/ftp/FTPClientConfig.java main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryPa
Author: sebb Date: Tue Feb 7 23:23:36 2017 New Revision: 1782089 URL: http://svn.apache.org/viewvc?rev=1782089&view=rev Log: NET-602 Failure to parse times from SYST_L8 systems that report as "WINDOWS Type: L8" Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782089&r1=1782088&r2=1782089&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Tue Feb 7 23:23:36 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +Failure to parse times from SYST_L8 systems that report as "WINDOWS Type: L8" + TFTP send & receive don't have progress indication Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java?rev=1782089&r1=1782088&r2=1782089&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java Tue Feb 7 23:23:36 2017 @@ -351,6 +351,17 @@ public class FTPClientConfig this.shortMonthNames = config.shortMonthNames; } +public FTPClientConfig(FTPClientConfig config) { +this.serverSystemKey = config.serverSystemKey; +this.defaultDateFormatStr = config.defaultDateFormatStr; +this.lenientFutureDates = config.lenientFutureDates; +this.recentDateFormatStr = config.recentDateFormatStr; +this.saveUnparseableEntries = config.saveUnparseableEntries; +this.serverLanguageCode = config.serverLanguageCode; +this.serverTimeZoneId = config.serverTimeZoneId; +this.shortMonthNames = config.shortMonthNames; +} + private static final Map LANGUAGE_CODE_MAP = new TreeMap(); static { Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java?rev=1782089&r1=1782088&r2=1782089&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/DefaultFTPFileEntryParserFactory.java Tue Feb 7 23:23:36 2017 @@ -240,11 +240,13 @@ public class DefaultFTPFileEntryParserFa { return new NTFTPEntryParser(config); } else { +// clone the config as it may be changed by the parsers (NET-602) +final FTPClientConfig config2 = (config != null) ? new FTPClientConfig(config) : null; return new CompositeFileEntryParser(new FTPFileEntryParser[] { new NTFTPEntryParser(config), - new UnixFTPEntryParser(config, - config != null && FTPClientConfig.SYST_UNIX_TRIM_LEADING.equals(config.getServerSystemKey())) + new UnixFTPEntryParser(config2, + config2 != null && FTPClientConfig.SYST_UNIX_TRIM_LEADING.equals(config2.getServerSystemKey())) }); } } @@ -273,11 +275,13 @@ public class DefaultFTPFileEntryParserFa { return new OS400FTPEntryParser(config); } else { +// clone the config as it may be changed by the parsers (NET-602) +final FTPClientConfig config2 = (config != null) ? new FTPClientConfig(config) : null; return new CompositeFileEntryParser(new FTPFileEntryParser[] { new OS400FTPEntryParser(config), -new UnixFTPEntryParser(config, -config != null && FTPClientConfig.SYST_UNIX_TRIM_LEADING.equals(config.getServerSystemKey())) +new UnixFTPEntryParser(config2, +config2 != null && FTPClientConfig.SYST_UNIX_TRIM_LEADING.equals(config2.getServerSystemKey())) }); } }
svn commit: r1782091 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/telnet/TelnetClient.java
Author: sebb Date: Tue Feb 7 23:52:49 2017 New Revision: 1782091 URL: http://svn.apache.org/viewvc?rev=1782091&view=rev Log: NET-596 NullPointerException when disconnecting TelnetClient twice with JDK 7 Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782091&r1=1782090&r2=1782091&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Tue Feb 7 23:52:49 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +NullPointerException when disconnecting TelnetClient twice with JDK 7 + Failure to parse times from SYST_L8 systems that report as "WINDOWS Type: L8" Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java?rev=1782091&r1=1782090&r2=1782091&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java Tue Feb 7 23:52:49 2017 @@ -80,7 +80,11 @@ public class TelnetClient extends Telnet } void _closeOutputStream() throws IOException { -_output_.close(); +try { +_output_.close(); +} finally { +_output_ = null; +} } /*** @@ -125,6 +129,8 @@ public class TelnetClient extends Telnet __output.close(); } } finally { // NET-594 +__output = null; +__input = null; super.disconnect(); } }
svn commit: r1782100 - /commons/proper/net/trunk/pom.xml
Author: sebb Date: Wed Feb 8 01:24:08 2017 New Revision: 1782100 URL: http://svn.apache.org/viewvc?rev=1782100&view=rev Log: Update to CP42 and exec 1.5.0 Modified: commons/proper/net/trunk/pom.xml Modified: commons/proper/net/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/pom.xml?rev=1782100&r1=1782099&r2=1782100&view=diff == --- commons/proper/net/trunk/pom.xml (original) +++ commons/proper/net/trunk/pom.xml Wed Feb 8 01:24:08 2017 @@ -22,7 +22,7 @@ org.apache.commons commons-parent -40 +42 4.0.0 commons-net @@ -423,7 +423,7 @@ Supported protocols include: Echo, Finge org.codehaus.mojo exec-maven-plugin -1.4.0 +1.5.0
[text] TEXT-63 Mutable fields should be private
Repository: commons-text Updated Branches: refs/heads/master 7a96b5000 -> 5066ac6f1 TEXT-63 Mutable fields should be private Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/5066ac6f Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/5066ac6f Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/5066ac6f Branch: refs/heads/master Commit: 5066ac6f1ce5dfd729e8269d10680f23103e404a Parents: 7a96b50 Author: Sebb Authored: Wed Feb 8 10:40:43 2017 + Committer: Sebb Committed: Wed Feb 8 10:40:43 2017 + -- src/changes/changes.xml| 4 src/main/java/org/apache/commons/text/beta/StrBuilder.java | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-text/blob/5066ac6f/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 88e9c52..6a567ec 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -45,6 +45,10 @@ The type attribute can be add,update,fix,remove. + + Mutable fields should be private + + Incorporate suggestions from RC2 into 1.0 release Naming packages org.apache.commons.text.beta http://git-wip-us.apache.org/repos/asf/commons-text/blob/5066ac6f/src/main/java/org/apache/commons/text/beta/StrBuilder.java -- diff --git a/src/main/java/org/apache/commons/text/beta/StrBuilder.java b/src/main/java/org/apache/commons/text/beta/StrBuilder.java index 260055a..5043fd6 100644 --- a/src/main/java/org/apache/commons/text/beta/StrBuilder.java +++ b/src/main/java/org/apache/commons/text/beta/StrBuilder.java @@ -82,9 +82,9 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build private static final long serialVersionUID = 7628716375283629643L; /** Internal data storage. */ -protected char[] buffer; // TODO make private? +char[] buffer; // package-protected for test code use only /** Current size of the buffer. */ -protected int size; // TODO make private? +private int size; /** The new line. */ private String newLine; /** The null text. */
svn commit: r1782149 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java
Author: sebb Date: Wed Feb 8 12:16:10 2017 New Revision: 1782149 URL: http://svn.apache.org/viewvc?rev=1782149&view=rev Log: Javadoc tweaks Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java?rev=1782149&r1=1782148&r2=1782149&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/DatagramSocketClient.java Wed Feb 8 12:16:10 2017 @@ -155,8 +155,6 @@ public abstract class DatagramSocketClie * You should call this method after you've finished using the class * instance and also before you call {@link #open open() } * again. _isOpen_ is set to false and _socket_ is set to null. - * If you call this method when the client socket is not open, - * a NullPointerException is thrown. ***/ public void close() { @@ -171,7 +169,7 @@ public abstract class DatagramSocketClie /*** * Returns true if the client has a currently open socket. * - * @return True if the client has a curerntly open socket, false otherwise. + * @return True if the client has a currently open socket, false otherwise. ***/ public boolean isOpen() {
svn commit: r1782174 - /commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java
Author: sebb Date: Wed Feb 8 14:09:10 2017 New Revision: 1782174 URL: http://svn.apache.org/viewvc?rev=1782174&view=rev Log: Split into smaller methods. Show sent and received counts Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java?rev=1782174&r1=1782173&r2=1782174&view=diff == --- commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java (original) +++ commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Wed Feb 8 14:09:10 2017 @@ -17,6 +17,7 @@ package examples.ftp; +import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -108,150 +109,161 @@ public final class TFTPExample // We want to timeout if a response takes longer than 60 seconds tftp.setDefaultTimeout(6); -// Open local socket +// We haven't closed the local file yet. +closed = false; + +// If we're receiving a file, receive, otherwise send. +if (receiveFile) +{ +closed = receive(transferMode, hostname, localFilename, remoteFilename, tftp); +} else { +// We're sending a file +closed = send(transferMode, hostname, localFilename, remoteFilename, tftp); +} + +System.out.println("Recd: "+tftp.getTotalBytesReceived()+" Sent: "+tftp.getTotalBytesSent()); + +if (!closed) { +System.out.println("Failed"); +System.exit(1); +} + +System.out.println("OK"); +} + +private static boolean send(int transferMode, String hostname, String localFilename, String remoteFilename, +TFTPClient tftp) { +boolean closed; +FileInputStream input = null; + +// Try to open local file for reading try { -tftp.open(); +input = new FileInputStream(localFilename); } -catch (SocketException e) +catch (IOException e) { -System.err.println("Error: could not open local UDP socket."); +tftp.close(); +System.err.println("Error: could not open local file for reading."); System.err.println(e.getMessage()); System.exit(1); } -// We haven't closed the local file yet. -closed = false; +open(tftp); -// If we're receiving a file, receive, otherwise send. -if (receiveFile) +// Try to send local file via TFTP +try +{ +tftp.sendFile(remoteFilename, transferMode, input, hostname); +} +catch (UnknownHostException e) +{ +System.err.println("Error: could not resolve hostname."); +System.err.println(e.getMessage()); +System.exit(1); +} +catch (IOException e) +{ +System.err.println("Error: I/O exception occurred while sending file."); +System.err.println(e.getMessage()); +System.exit(1); +} +finally { -FileOutputStream output = null; -File file; +// Close local socket and input file +closed = close(tftp, input); +} -file = new File(localFilename); +return closed; +} -// If file exists, don't overwrite it. -if (file.exists()) -{ -System.err.println("Error: " + localFilename + " already exists."); -System.exit(1); -} +private static boolean receive(int transferMode, String hostname, String localFilename, String remoteFilename, +TFTPClient tftp) { +boolean closed; +FileOutputStream output = null; +File file; -// Try to open local file for writing -try -{ -output = new FileOutputStream(file); -} -catch (IOException e) -{ -tftp.close(); -System.err.println("Error: could not open local file for writing."); -System.err.println(e.getMessage()); -System.exit(1); -} +file = new File(localFilename); -// Try to receive remote file via TFTP -try -{ -tftp.receiveFile(remoteFilename, transferMode, output, hostname); -} -catch (UnknownHostException e) -{ -System.err.println("Error: coul
svn commit: r1782280 - /commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java
Author: sebb Date: Wed Feb 8 23:34:34 2017 New Revision: 1782280 URL: http://svn.apache.org/viewvc?rev=1782280&view=rev Log: Allow override of timeout and port Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java?rev=1782280&r1=1782279&r2=1782280&view=diff == --- commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java (original) +++ commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Wed Feb 8 23:34:34 2017 @@ -33,7 +33,7 @@ import org.apache.commons.net.tftp.TFTPC * error handling. * * Usage: tftp [options] hostname localfile remotefile - * hostname - The name of the remote host + * hostname - The name of the remote host, with optional :port * localfile - The name of the local file to send or the name to use for * the received file * remotefile - The name of the remote file to receive or the name for @@ -48,12 +48,13 @@ public final class TFTPExample { static final String USAGE = "Usage: tftp [options] hostname localfile remotefile\n\n" + -"hostname - The name of the remote host\n" + +"hostname - The name of the remote host [:port]\n" + "localfile - The name of the local file to send or the name to use for\n" + "\tthe received file\n" + "remotefile - The name of the remote file to receive or the name for\n" + "\tthe remote server to use to name the local file being sent.\n\n" + "options: (The default is to assume -r -b)\n" + +"\t-t timeout in seconds (default 60s)\n" + "\t-s Send a local file\n" + "\t-r Receive a remote file\n" + "\t-a Use ASCII transfer mode\n" + @@ -65,6 +66,7 @@ public final class TFTPExample int transferMode = TFTP.BINARY_MODE, argc; String arg, hostname, localFilename, remoteFilename; TFTPClient tftp; +int timeout = 6; // Parse options for (argc = 0; argc < args.length; argc++) @@ -80,6 +82,8 @@ public final class TFTPExample transferMode = TFTP.ASCII_MODE; } else if (arg.equals("-b")) { transferMode = TFTP.BINARY_MODE; +} else if (arg.equals("-t")) { +timeout = 1000*Integer.parseInt(args[++argc]); } else { System.err.println("Error: unrecognized option."); System.err.print(USAGE); @@ -107,7 +111,7 @@ public final class TFTPExample tftp = new TFTPClient(); // We want to timeout if a response takes longer than 60 seconds -tftp.setDefaultTimeout(6); +tftp.setDefaultTimeout(timeout); // We haven't closed the local file yet. closed = false; @@ -154,7 +158,12 @@ public final class TFTPExample // Try to send local file via TFTP try { -tftp.sendFile(remoteFilename, transferMode, input, hostname); +String [] parts = hostname.split(":"); +if (parts.length == 2) { +tftp.sendFile(remoteFilename, transferMode, input, parts[0], Integer.parseInt(parts[1])); +} else { +tftp.sendFile(remoteFilename, transferMode, input, hostname); +} } catch (UnknownHostException e) { @@ -210,7 +219,12 @@ public final class TFTPExample // Try to receive remote file via TFTP try { -tftp.receiveFile(remoteFilename, transferMode, output, hostname); +String [] parts = hostname.split(":"); +if (parts.length == 2) { +tftp.receiveFile(remoteFilename, transferMode, output, parts[0], Integer.parseInt(parts[1])); +} else { +tftp.receiveFile(remoteFilename, transferMode, output, hostname); +} } catch (UnknownHostException e) {
svn commit: r1782281 - in /commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp: TFTPAckPacket.java TFTPDataPacket.java TFTPErrorPacket.java TFTPPacket.java TFTPReadRequestPacket.java TF
Author: sebb Date: Wed Feb 8 23:47:34 2017 New Revision: 1782281 URL: http://svn.apache.org/viewvc?rev=1782281&view=rev Log: Add toString() representations for use in debugging Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPWriteRequestPacket.java Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java?rev=1782281&r1=1782280&r2=1782281&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java Wed Feb 8 23:47:34 2017 @@ -158,5 +158,11 @@ public final class TFTPAckPacket extends { _blockNumber = blockNumber; } + +// for debugging +@Override +public String toString() { +return super.toString() + " ACK " + _blockNumber; +} } Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java?rev=1782281&r1=1782280&r2=1782281&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java Wed Feb 8 23:47:34 2017 @@ -257,4 +257,10 @@ public final class TFTPDataPacket extend { return _data; } + +// for debugging +@Override +public String toString() { +return super.toString() + " DATA " + _blockNumber + " " + _length; +} } Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java?rev=1782281&r1=1782280&r2=1782281&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java Wed Feb 8 23:47:34 2017 @@ -224,4 +224,10 @@ public final class TFTPErrorPacket exten { return _message; } + +// for debugging +@Override +public String toString() { +return super.toString() + " ERR " + _error + " " + _message; +} } Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java?rev=1782281&r1=1782280&r2=1782281&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java Wed Feb 8 23:47:34 2017 @@ -249,4 +249,10 @@ public abstract class TFTPPacket { _address = address; } + +// for debugging +@Override +public String toString() { +return _address + " " + _port + " " + _type; +} } Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java?rev=1782281&r1=1782280&r2=1782281&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java Wed Feb 8 23:47:34 2017 @@ -76,4 +76,9 @@ public final class TFTPReadRequestPacket super(TFTPPacket.READ_REQUEST, datagram); } +// for debugging +@Override +public String toString() { +return super.toString() + " RRQ " + getFilename() + " "
svn commit: r1782283 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/tftp/TFTP.java
Author: sebb Date: Thu Feb 9 00:09:24 2017 New Revision: 1782283 URL: http://svn.apache.org/viewvc?rev=1782283&view=rev Log: NET-612 Allow TFTP socket IO tracing Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782283&r1=1782282&r2=1782283&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Thu Feb 9 00:09:24 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +Allow TFTP socket IO tracing + NullPointerException when disconnecting TelnetClient twice with JDK 7 Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java?rev=1782283&r1=1782282&r2=1782283&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java Thu Feb 9 00:09:24 2017 @@ -201,7 +201,9 @@ public class TFTP extends DatagramSocket __receiveDatagram.setLength(__receiveBuffer.length); _socket_.receive(__receiveDatagram); -return TFTPPacket.newTFTPPacket(__receiveDatagram); +TFTPPacket newTFTPPacket = TFTPPacket.newTFTPPacket(__receiveDatagram); +trace("<", newTFTPPacket); +return newTFTPPacket; } /*** @@ -224,6 +226,7 @@ public class TFTP extends DatagramSocket ***/ public final void bufferedSend(TFTPPacket packet) throws IOException { +trace(">", packet); _socket_.send(packet._newDatagram(__sendDatagram, _sendBuffer)); } @@ -266,6 +269,7 @@ public class TFTP extends DatagramSocket ***/ public final void send(TFTPPacket packet) throws IOException { +trace(">", packet); _socket_.send(packet.newDatagram()); } @@ -294,8 +298,15 @@ public class TFTP extends DatagramSocket _socket_.receive(packet); -return TFTPPacket.newTFTPPacket(packet); +TFTPPacket newTFTPPacket = TFTPPacket.newTFTPPacket(packet); +trace("<", newTFTPPacket); +return newTFTPPacket; } +// Override this to trace the packet flow +protected void trace(String direction, TFTPPacket packet) { +// Simple implementation: +//System.out.println(direction + " " + packet.toString()); +} }
svn commit: r1782352 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/tftp/TFTPClient.java
Author: sebb Date: Thu Feb 9 15:53:39 2017 New Revision: 1782352 URL: http://svn.apache.org/viewvc?rev=1782352&view=rev Log: NET-477 TFTP sendFile retry broken Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782352&r1=1782351&r2=1782352&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Thu Feb 9 15:53:39 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +TFTP sendFile retry broken + Allow TFTP socket IO tracing Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java?rev=1782352&r1=1782351&r2=1782352&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Thu Feb 9 15:53:39 2017 @@ -146,166 +146,115 @@ public class TFTPClient extends TFTP public int receiveFile(String filename, int mode, OutputStream output, InetAddress host, int port) throws IOException { -int bytesRead, timeouts, lastBlock, block, hostPort, dataLength; -TFTPPacket sent, received = null; -TFTPErrorPacket error; -TFTPDataPacket data; -TFTPAckPacket ack = new TFTPAckPacket(host, port, 0); - -beginBufferedOps(); +int bytesRead = 0; +int lastBlock = 0; +int block = 1; +int hostPort = 0; +int dataLength = 0; -dataLength = lastBlock = hostPort = bytesRead = 0; totalBytesReceived = 0; -block = 1; if (mode == TFTP.ASCII_MODE) { output = new FromNetASCIIOutputStream(output); } -sent = -new TFTPReadRequestPacket(host, port, filename, mode); - -_sendPacket: -do -{ -bufferedSend(sent); - -_receivePacket: -while (true) -{ -timeouts = 0; -do { -try -{ -received = bufferedReceive(); -break; -} -catch (SocketException e) -{ -if (++timeouts >= __maxTimeouts) -{ -endBufferedOps(); -throw new IOException("Connection timed out."); -} -continue _sendPacket; -} -catch (InterruptedIOException e) -{ -if (++timeouts >= __maxTimeouts) -{ -endBufferedOps(); -throw new IOException("Connection timed out."); -} -continue _sendPacket; -} -catch (TFTPPacketException e) -{ -endBufferedOps(); -throw new IOException("Bad packet: " + e.getMessage()); -} -} while (timeouts < __maxTimeouts); // __maxTimeouts >=1 so will always do loop at least once - -// The first time we receive we get the port number and -// answering host address (for hosts with multiple IPs) -if (lastBlock == 0) -{ -hostPort = received.getPort(); -ack.setPort(hostPort); -if(!host.equals(received.getAddress())) -{ -host = received.getAddress(); -ack.setAddress(host); -sent.setAddress(host); -} -} - -// Comply with RFC 783 indication that an error acknowledgment -// should be sent to originator if unexpected TID or host. -if (host.equals(received.getAddress()) && -received.getPort() == hostPort) -{ - -switch (received.getType()) -{ -
svn commit: r1782356 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/tftp/TFTPClient.java
Author: sebb Date: Thu Feb 9 16:09:31 2017 New Revision: 1782356 URL: http://svn.apache.org/viewvc?rev=1782356&view=rev Log: NET-414 Apache Commons TFTP does not reject request replies that originate from a control port. Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782356&r1=1782355&r2=1782356&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Thu Feb 9 16:09:31 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +Apache Commons TFTP does not reject request replies that originate from a control port. + TFTP sendFile retry broken Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java?rev=1782356&r1=1782355&r2=1782356&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Thu Feb 9 16:09:31 2017 @@ -177,6 +177,13 @@ public class TFTPClient extends TFTP final InetAddress recdAddress = received.getAddress(); if (lastBlock == 0) { +if (recdPort == port) { // must not use the control port here +TFTPErrorPacket error = new TFTPErrorPacket(recdAddress, +recdPort, TFTPErrorPacket.UNKNOWN_TID, +"INCORRECT SOURCE PORT"); +bufferedSend(error); +throw new IOException("Incorrect source port ("+recdPort+") in request reply."); +} hostPort = recdPort; ack.setPort(hostPort); if(!host.equals(recdAddress)) @@ -377,6 +384,13 @@ public class TFTPClient extends TFTP // answering host address (for hosts with multiple IPs) if (justStarted) { justStarted = false; +if (recdPort == port) { // must not use the control port here +TFTPErrorPacket error = new TFTPErrorPacket(recdAddress, +recdPort, TFTPErrorPacket.UNKNOWN_TID, +"INCORRECT SOURCE PORT"); +bufferedSend(error); +throw new IOException("Incorrect source port ("+recdPort+") in request reply."); +} hostPort = recdPort; data.setPort(hostPort); if (!host.equals(recdAddress)) {
svn commit: r1782366 - /commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java
Author: sebb Date: Thu Feb 9 16:30:42 2017 New Revision: 1782366 URL: http://svn.apache.org/viewvc?rev=1782366&view=rev Log: Add verbose mode Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java?rev=1782366&r1=1782365&r2=1782366&view=diff == --- commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java (original) +++ commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Thu Feb 9 16:30:42 2017 @@ -26,6 +26,7 @@ import java.net.SocketException; import java.net.UnknownHostException; import org.apache.commons.net.tftp.TFTP; import org.apache.commons.net.tftp.TFTPClient; +import org.apache.commons.net.tftp.TFTPPacket; /*** * This is an example of a simple Java tftp client. @@ -58,15 +59,18 @@ public final class TFTPExample "\t-s Send a local file\n" + "\t-r Receive a remote file\n" + "\t-a Use ASCII transfer mode\n" + -"\t-b Use binary transfer mode\n"; +"\t-b Use binary transfer mode\n" + +"\t-v Verbose (trace packets)\n" +; public static void main(String[] args) { boolean receiveFile = true, closed; int transferMode = TFTP.BINARY_MODE, argc; String arg, hostname, localFilename, remoteFilename; -TFTPClient tftp; +final TFTPClient tftp; int timeout = 6; +boolean verbose = false; // Parse options for (argc = 0; argc < args.length; argc++) @@ -84,6 +88,8 @@ public final class TFTPExample transferMode = TFTP.BINARY_MODE; } else if (arg.equals("-t")) { timeout = 1000*Integer.parseInt(args[++argc]); +} else if (arg.equals("-v")) { +verbose = true; } else { System.err.println("Error: unrecognized option."); System.err.print(USAGE); @@ -108,7 +114,16 @@ public final class TFTPExample remoteFilename = args[argc + 2]; // Create our TFTP instance to handle the file transfer. -tftp = new TFTPClient(); +if (verbose) { +tftp = new TFTPClient() { +@Override +protected void trace(String direction, TFTPPacket packet) { +System.out.println(direction + " " + packet); +} +}; +} else { +tftp = new TFTPClient(); +} // We want to timeout if a response takes longer than 60 seconds tftp.setDefaultTimeout(timeout);
svn commit: r1782371 - in /commons/proper/net/trunk/src: changes/changes.xml test/java/org/apache/commons/net/tftp/TFTPServer.java
Author: sebb Date: Thu Feb 9 16:59:58 2017 New Revision: 1782371 URL: http://svn.apache.org/viewvc?rev=1782371&view=rev Log: NET-320 Allow TFTPServer.java to bind to a specific network adapter Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782371&r1=1782370&r2=1782371&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Thu Feb 9 16:59:58 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +Allow TFTPServer.java to bind to a specific network adapter + Apache Commons TFTP does not reject request replies that originate from a control port. Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java?rev=1782371&r1=1782370&r2=1782371&view=diff == --- commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java (original) +++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java Thu Feb 9 16:59:58 2017 @@ -27,8 +27,11 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; +import java.net.InetAddress; +import java.net.NetworkInterface; import java.net.SocketTimeoutException; import java.util.HashSet; +import java.util.Enumeration; import java.util.Iterator; import org.apache.commons.net.io.FromNetASCIIOutputStream; @@ -89,6 +92,7 @@ public class TFTPServer implements Runna private File serverReadDirectory_; private File serverWriteDirectory_; private final int port_; +private final InetAddress laddr_; private Exception serverException = null; private final ServerMode mode_; @@ -161,6 +165,81 @@ public class TFTPServer implements Runna mode_ = mode; log_ = (log == null ? nullStream: log); logError_ = (errorLog == null ? nullStream : errorLog); +laddr_ = null; +launch(serverReadDirectory, serverWriteDirectory); +} + +/** + * Start a TFTP Server on the specified port. Gets and Puts occur in the specified directory. + * + * The server will start in another thread, allowing this constructor to return immediately. + * + * If a get or a put comes in with a relative path that tries to get outside of the + * serverDirectory, then the get or put will be denied. + * + * GET_ONLY mode only allows gets, PUT_ONLY mode only allows puts, and GET_AND_PUT allows both. + * Modes are defined as int constants in this class. + * + * @param serverReadDirectory directory for GET requests + * @param serverWriteDirectory directory for PUT requests + * @param port The local port to bind to. + * @param localaddr The local address to bind to. + * @param mode A value as specified above. + * @param log Stream to write log message to. If not provided, uses System.out + * @param errorLog Stream to write error messages to. If not provided, uses System.err. + * @throws IOException if the server directory is invalid or does not exist. + */ +public TFTPServer(File serverReadDirectory, File serverWriteDirectory, int port, +InetAddress localaddr, ServerMode mode, PrintStream log, PrintStream errorLog) +throws IOException +{ +port_ = port; +mode_ = mode; +laddr_ = localaddr; +log_ = (log == null ? nullStream: log); +logError_ = (errorLog == null ? nullStream : errorLog); +launch(serverReadDirectory, serverWriteDirectory); +} + +/** + * Start a TFTP Server on the specified port. Gets and Puts occur in the specified directory. + * + * The server will start in another thread, allowing this constructor to return immediately. + * + * If a get or a put comes in with a relative path that tries to get outside of the + * serverDirectory, then the get or put will be denied. + * + * GET_ONLY mode only allows gets, PUT_ONLY mode only allows puts, and GET_AND_PUT allows both. + * Modes are defined as int constants in this class. + * + * @param serverReadDirectory directory for GET requests + * @param serverWriteDirectory directory for PUT requests + * @param port the port
svn commit: r1782372 - in /commons/proper/net/trunk/src: changes/changes.xml main/java/org/apache/commons/net/tftp/TFTPClient.java
Author: sebb Date: Thu Feb 9 17:43:30 2017 New Revision: 1782372 URL: http://svn.apache.org/viewvc?rev=1782372&view=rev Log: NET-613 TFTPClient assumes that lastBlock == 0 only once Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Modified: commons/proper/net/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/changes/changes.xml?rev=1782372&r1=1782371&r2=1782372&view=diff == --- commons/proper/net/trunk/src/changes/changes.xml [utf-8] (original) +++ commons/proper/net/trunk/src/changes/changes.xml [utf-8] Thu Feb 9 17:43:30 2017 @@ -87,6 +87,9 @@ without checking it if is a space. The POP3Mail examples can now get password from console, stdin or an environment variable. "> + +TFTPClient assumes that lastBlock == 0 only once + Allow TFTPServer.java to bind to a specific network adapter Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java?rev=1782372&r1=1782371&r2=1782372&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java Thu Feb 9 17:43:30 2017 @@ -163,6 +163,7 @@ public class TFTPClient extends TFTP beginBufferedOps(); +boolean justStarted = true; try { do { // while more data to fetch bufferedSend(sent); // start the fetch/send an ack @@ -175,8 +176,8 @@ public class TFTPClient extends TFTP // answering host address (for hosts with multiple IPs) final int recdPort = received.getPort(); final InetAddress recdAddress = received.getAddress(); -if (lastBlock == 0) -{ +if (justStarted) { +justStarted = false; if (recdPort == port) { // must not use the control port here TFTPErrorPacket error = new TFTPErrorPacket(recdAddress, recdPort, TFTPErrorPacket.UNKNOWN_TID,
svn commit: r1782409 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java
Author: sebb Date: Thu Feb 9 22:34:09 2017 New Revision: 1782409 URL: http://svn.apache.org/viewvc?rev=1782409&view=rev Log: Allow customisation of the behaviour Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java?rev=1782409&r1=1782408&r2=1782409&view=diff == --- commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java (original) +++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java Thu Feb 9 22:34:09 2017 @@ -461,7 +461,7 @@ public class TFTPServer implements Runna { try { -transferTftp_ = new TFTP(); +transferTftp_ = newTFTP(); transferTftp_.beginBufferedOps(); transferTftp_.setDefaultTimeout(socketTimeout_); @@ -575,7 +575,7 @@ public class TFTPServer implements Runna lastSentData = new TFTPDataPacket(trrp.getAddress(), trrp.getPort(), block, temp, 0, readLength); -transferTftp_.bufferedSend(lastSentData); +sendData(transferTftp_, lastSentData); // send the data } answer = null; @@ -716,7 +716,7 @@ public class TFTPServer implements Runna } TFTPAckPacket lastSentAck = new TFTPAckPacket(twrp.getAddress(), twrp.getPort(), 0); -transferTftp_.bufferedSend(lastSentAck); +sendData(transferTftp_, lastSentAck); // send the data while (true) { @@ -791,7 +791,7 @@ public class TFTPServer implements Runna } lastSentAck = new TFTPAckPacket(twrp.getAddress(), twrp.getPort(), block); -transferTftp_.bufferedSend(lastSentAck); +sendData(transferTftp_, lastSentAck); // send the data if (dataLength < TFTPDataPacket.MAX_DATA_LENGTH) { // end of stream signal - The tranfer is complete. @@ -946,4 +946,18 @@ public class TFTPServer implements Runna { this.logError_ = logError; } + +/* + * Allow test code to customise the TFTP instance + */ +TFTP newTFTP() { +return new TFTP(); +} + +/* + * Also allow customisation of sending data/ack so can generate errors if needed + */ +void sendData(TFTP tftp, TFTPPacket data) throws IOException { +tftp.bufferedSend(data); +} }
svn commit: r1782415 - /commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServerMain.java
Author: sebb Date: Thu Feb 9 23:19:19 2017 New Revision: 1782415 URL: http://svn.apache.org/viewvc?rev=1782415&view=rev Log: CLI app for running TFTPServer Added: commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServerMain.java (with props) Added: commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServerMain.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServerMain.java?rev=1782415&view=auto == --- commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServerMain.java (added) +++ commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServerMain.java Thu Feb 9 23:19:19 2017 @@ -0,0 +1,150 @@ +/* + * 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.commons.net.tftp; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; + +/** + * Main class for TFTPServer. + * This allows CLI use of the server. + */ +public class TFTPServerMain { + +private static final String USAGE = +"Usage: TFTPServerMain [options] [port]\n\n" + +"port - the port to use (default 6901)\n" + +"\t-p path to server directory (default java.io.tempdir)\n" + +"\t-r randomly introduce errors\n" + +"\t-v verbose (trace packets)\n" +; + +public static void main(String [] args) throws Exception { +int port = 6901; +int argc; +Map opts = new HashMap(); +opts.put("-p", System.getProperty("java.io.tmpdir")); +// Parse options +for (argc = 0; argc < args.length; argc++) +{ +String arg = args[argc]; +if (arg.startsWith("-")) +{ +if (arg.equals("-v")) { +opts.put(arg, arg); +} else if (arg.equals("-r")) { +opts.put(arg, arg); +} else if (arg.equals("-p")) { +opts.put(arg, args[++argc]); +} else { +System.err.println("Error: unrecognized option."); +System.err.print(USAGE); +System.exit(1); +} +} else { +break; +} +} + +if (argc < args.length) { +port = Integer.parseInt(args[argc]); +argc++; +} +final boolean verbose = opts.containsKey("-v"); +final boolean randomErrors = opts.containsKey("-r"); +final Random rand = randomErrors ? new Random() : null; + +final File serverDirectory = new File(opts.get("-p")); +System.out.println("Server directory: " + serverDirectory); +final TFTPServer tftpS = new TFTPServer(serverDirectory, serverDirectory, port, +TFTPServer.ServerMode.GET_AND_PUT, null, null){ +@Override +void sendData(TFTP tftp, TFTPPacket packet) throws IOException { +if (rand == null) { +super.sendData(tftp, packet); +return; +} +int rint = rand.nextInt(10); +switch(rint) { +case 0: +System.out.println("Bump port " + packet); +int port = packet.getPort(); +packet.setPort(port+5); +super.sendData(tftp, packet); +packet.setPort(port); +break; +case 1: +if (packet instanceof TFTPDataPacket) { +TFTPDataPacket data = (TFTPDataPacket) packet; +System.out.println("Change data block num"); +data._blockNumber--; +
svn commit: r1782541 - in /commons/proper/net/trunk: CONTRIBUTING.md README.md
Author: sebb Date: Fri Feb 10 23:19:39 2017 New Revision: 1782541 URL: http://svn.apache.org/viewvc?rev=1782541&view=rev Log: EOL-stye Modified: commons/proper/net/trunk/CONTRIBUTING.md (props changed) commons/proper/net/trunk/README.md (props changed) Propchange: commons/proper/net/trunk/CONTRIBUTING.md -- svn:executable = * Propchange: commons/proper/net/trunk/README.md -- svn:eol-style = native
svn commit: r1782542 - /commons/proper/net/trunk/CONTRIBUTING.md
Author: sebb Date: Fri Feb 10 23:21:41 2017 New Revision: 1782542 URL: http://svn.apache.org/viewvc?rev=1782542&view=rev Log: Update to latest generated output Modified: commons/proper/net/trunk/CONTRIBUTING.md Modified: commons/proper/net/trunk/CONTRIBUTING.md URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/CONTRIBUTING.md?rev=1782542&r1=1782541&r2=1782542&view=diff == --- commons/proper/net/trunk/CONTRIBUTING.md (original) +++ commons/proper/net/trunk/CONTRIBUTING.md Fri Feb 10 23:21:41 2017 @@ -51,47 +51,65 @@ Getting Started + Make sure you have a [JIRA account](https://issues.apache.org/jira/). + Make sure you have a [GitHub account](https://github.com/signup/free). + If you're planning to implement a new feature it makes sense to discuss you're changes on the [dev list](https://commons.apache.org/mail-lists.html) first. This way you can make sure you're not wasting your time on something that isn't considered to be in Apache Commons Net's scope. -+ Submit a ticket for your issue, assuming one does not already exist. ++ Submit a [Jira Ticket][jira] for your issue, assuming one does not already exist. + Clearly describe the issue including steps to reproduce when it is a bug. + Make sure you fill in the earliest version that you know has the issue. -+ Fork the repository on GitHub. ++ Find the corresponding [repository on GitHub](https://github.com/apache/?query=commons-), +[fork](https://help.github.com/articles/fork-a-repo/) and check out your forked repository. Making Changes -- -+ Create a topic branch from where you want to base your work (this is usually the master/trunk branch). ++ Create a _topic branch_ for your isolated work. + * Usually you should base your branch on the `master` or `trunk` branch. + * A good topic branch name can be the JIRA bug id plus a keyword, e.g. `NET-123-InputStream`. + * If you have submitted multiple JIRA issues, try to maintain separate branches and pull requests. + Make commits of logical units. + * Make sure your commit messages are meaningful and in the proper format. Your commit message should contain the key of the JIRA issue. + * e.g. `NET-123: Close input stream earlier` + Respect the original code style: + Only use spaces for indentation. - + Create minimal diffs - disable on save actions like reformat source code or organize imports. If you feel the source code should be reformatted create a separate PR for this change. - + Check for unnecessary whitespace with git diff --check before committing. -+ Make sure your commit messages are in the proper format. Your commit message should contain the key of the JIRA issue. -+ Make sure you have added the necessary tests for your changes. + + Create minimal diffs - disable _On Save_ actions like _Reformat Source Code_ or _Organize Imports_. If you feel the source code should be reformatted create a separate PR for this change first. + + Check for unnecessary whitespace with `git diff` -- check before committing. ++ Make sure you have added the necessary tests for your changes, typically in `src/test/java`. + Run all the tests with `mvn clean verify` to assure nothing else was accidentally broken. Making Trivial Changes -- +The JIRA tickets are used to generate the changelog for the next release. + For changes of a trivial nature to comments and documentation, it is not always necessary to create a new ticket in JIRA. In this case, it is appropriate to start the first line of a commit with '(doc)' instead of a ticket number. + Submitting Changes -- -+ Sign the [Contributor License Agreement][cla] if you haven't already. ++ Sign and submit the Apache [Contributor License Agreement][cla] if you haven't already. + * Note that small patches & typical bug fixes do not require a CLA as +clause 5 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0.html#contributions) +covers them. + Push your changes to a topic branch in your fork of the repository. -+ Submit a pull request to the repository in the apache organization. ++ Submit a _Pull Request_ to the corresponding repository in the `apache` organization. + * Verify _Files Changed_ shows only your intended changes and does not + include additional files like `target/*.class` + Update your JIRA ticket and include a link to the pull request in the ticket. +If you prefer to not use GitHub, then you can instead use +`git format-patch` (or `svn diff`) and attach the patch file to the JIRA issue. + + Additional Resources + [Contributing patches](https://commons.apache.org/patches.html) -+ [Apache Commons Net JIRA project page](https://issues.apache.org/jira/browse/NET) ++ [Apache Commons Net JIRA project page][jira] + [Contributor License Agreemen
svn commit: r1782543 - /commons/proper/net/trunk/README.md
Author: sebb Date: Fri Feb 10 23:23:07 2017 New Revision: 1782543 URL: http://svn.apache.org/viewvc?rev=1782543&view=rev Log: Update to latest generated output Modified: commons/proper/net/trunk/README.md Modified: commons/proper/net/trunk/README.md URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/README.md?rev=1782543&r1=1782542&r2=1782543&view=diff == --- commons/proper/net/trunk/README.md (original) +++ commons/proper/net/trunk/README.md Fri Feb 10 23:23:07 2017 @@ -43,13 +43,18 @@ Apache Commons Net === +[](https://travis-ci.org/apache/commons-net) +[](https://coveralls.io/r/apache/commons-net) +[](https://maven-badges.herokuapp.com/maven-central/commons-net/commons-net/) +[](http://www.apache.org/licenses/LICENSE-2.0.html) + Apache Commons Net library contains a collection of network utilities and protocol implementations. Supported protocols include: Echo, Finger, FTP, NNTP, NTP, POP3(S), SMTP(S), Telnet, Whois Documentation - -More information can be found on the [homepage](https://commons.apache.org/proper/commons-net). +More information can be found on the [Apache Commons Net homepage](https://commons.apache.org/proper/commons-net). The [JavaDoc](https://commons.apache.org/proper/commons-net/javadocs/api-release) can be browsed. Questions related to the usage of Apache Commons Net should be posted to the [user mailing list][ml]. @@ -63,14 +68,14 @@ Alternatively you can pull it from the c commons-net commons-net - 3.5-SNAPSHOT + 3.6 ``` Contributing -We accept PRs via github. The [developer mailing list][ml] is the main channel of communication for contributors. +We accept Pull Requests via GitHub. The [developer mailing list][ml] is the main channel of communication for contributors. There are some guidelines which will make applying PRs easier for us: + No tabs! Please use spaces for indentation. + Respect the code style. @@ -82,7 +87,9 @@ You can learn more about contributing vi License --- -Code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0.txt). +This code is under the [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0). + +See the `NOTICE.txt` file for required notices and attributions. Donations - @@ -92,8 +99,8 @@ Additional Resources + [Apache Commons Homepage](https://commons.apache.org/) -+ [Apache Bugtracker (JIRA)](https://issues.apache.org/jira/) ++ [Apache Issue Tracker (JIRA)](https://issues.apache.org/jira/browse/NET) + [Apache Commons Twitter Account](https://twitter.com/ApacheCommons) -+ #apachecommons IRC channel on freenode.org ++ `#apache-commons` IRC channel on `irc.freenode.org` [ml]:https://commons.apache.org/mail-lists.html
svn commit: r1782544 - in /commons/proper/net/trunk: RELEASE-NOTES.txt pom.xml src/changes/changes.xml
Author: sebb Date: Fri Feb 10 23:34:45 2017 New Revision: 1782544 URL: http://svn.apache.org/viewvc?rev=1782544&view=rev Log: Tweak docs; prepare for release Modified: commons/proper/net/trunk/RELEASE-NOTES.txt commons/proper/net/trunk/pom.xml commons/proper/net/trunk/src/changes/changes.xml Modified: commons/proper/net/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/RELEASE-NOTES.txt?rev=1782544&r1=1782543&r2=1782544&view=diff == --- commons/proper/net/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/net/trunk/RELEASE-NOTES.txt Fri Feb 10 23:34:45 2017 @@ -1,7 +1,7 @@ - Apache Commons Net 3.5 + Apache Commons Net 3.6 RELEASE NOTES -The Apache Commons Net team is pleased to announce the release of Apache Commons Net 3.5 +The Apache Commons Net team is pleased to announce the release of Apache Commons Net 3.6 Apache Commons Net library contains a collection of network utilities and protocol implementations. Supported protocols include: Echo, Finger, FTP, NNTP, NTP, POP3(S), SMTP(S), Telnet, Whois @@ -13,19 +13,42 @@ However it is not source compatible with The code now requires a minimum of Java 1.6. +Changes to functionality: +* The FTP client now performs stricter checks on non-multiline command replies. + The 3 digit code must now be followed by a space and some text, as per RFC 959. + To suppress this stricter checking, call FTP#setStrictReplyParsing(false). This should not be needed with a well-behaved server. + Note also that if strict checking is disabled, some functions may unconditionally strip the next character after the code, without checking it if is a space. +* The FTP client mlistFile() method now checks for a leading space before removing it. + If the space is missing, a MalformedServerReplyException is thrown. + This will only happen if the FTP server is not compliant with RFC 3659. + Notable additions: - The IMAP examples can now get password from console, stdin or an environment variable. +* The POP3Mail examples can now get password from console, stdin or an environment variable. +* TFTPClient code has been rewritten to improve error handling and retries. Changes in this version include: -New features: -o Alternative password input methods for IMAP examples -o More tests for Feb 29 handling. - Fixed Bugs: -o NET-583: FTPClient.getReplyString() returns wrong value after connect() Thanks to Holger Rehn. -o NET-586: Don't use Feb 29 for short future date tests -o Documentation tweaks +o NET-613: TFTPClient assumes that lastBlock == 0 only once +o NET-320: Allow TFTPServer.java to bind to a specific network adapter Thanks to Kevin Bulebush. +o NET-414: Apache Commons TFTP does not reject request replies that originate from a control port. Thanks to Chuck Wolber. +o NET-477: TFTP sendFile retry broken Thanks to John Walton. +o NET-596: NullPointerException when disconnecting TelnetClient twice with JDK 7 Thanks to Vincent Bories-Azeau. +o NET-602: Failure to parse times from SYST_L8 systems that report as "WINDOWS Type: L8" Thanks to Ross Braithwaite. +o NET-604: TFTP send and receive don't have progress indication Thanks to Frank Delporte. +o NET-588: FTPClient.setPassiveNatWorkaround assumes host is outside site local range Thanks to Dave Nice / Thai H. +o NET-610: FTPClient.mlistFile incorrectly handles MLST reply Thanks to Sergey Yanzin. +o NET-611: FTP does not validate command reply syntax fully +o NET-609: DefaultUnixFTPFileEntryParserFactory Issue (leading spaces removal configuration) Thanks to Tqup3. +o NET-597: FTP fails to parse listings for Solaris 10 FTPd in Japanese Thanks to Hiroki Taniura. +o NET-593: HostnameVerifier is called with ip addess instead of the provided hostname Thanks to Jörg Weule. +o NET-594: TelnetClient._closeOutputStream unhandled exception from FilterOutputStream.close Thanks to Brad Worrral. +o NET-592: plainSocket in FTPSClient is never closed Thanks to Mark Ford. + +Changes: +o NET-612: Allow TFTP socket IO tracing +o POP3Mail example: support host port; allow reading password from Console/stdin/environment +o NET-599: Add shorthand FTPClientConfig constructor Historical list of changes: http://commons.apache.org/proper/commons-net/changes-report.html Modified: commons/proper/net/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/pom.xml?rev=1782544&r1=1782543&r2=1782544&view=diff == --- commons/proper/net/trunk/pom.xml (original) +++ commons/proper/net/trunk/pom.xml Fri Feb 10 23:34:45 2017 @@ -177,8 +177,8 @@ Supported protocols include: Echo, Finge 12310487 -${project.version} -RC3 +
svn commit: r1782545 - in /commons/proper/net/trunk/src: main/java/org/apache/commons/net/ftp/ main/java/org/apache/commons/net/pop3/ main/java/org/apache/commons/net/tftp/ test/java/org/apache/common
Author: sebb Date: Fri Feb 10 23:59:31 2017 New Revision: 1782545 URL: http://svn.apache.org/viewvc?rev=1782545&view=rev Log: @since markers Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPAckPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPDataPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPErrorPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPReadRequestPacket.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPWriteRequestPacket.java commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServerMain.java Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java?rev=1782545&r1=1782544&r2=1782545&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java Fri Feb 10 23:59:31 2017 @@ -3780,7 +3780,7 @@ implements Configurable * The default is true, i.e. site-local replies are replaced. * @param enabled true to enable replacing internal IP's in passive * mode. - * @deprecated use {@link #setPassiveNatWorkaroundStrategy(HostnameResolver)} instead + * @deprecated (3.6) use {@link #setPassiveNatWorkaroundStrategy(HostnameResolver)} instead */ @Deprecated public void setPassiveNatWorkaround(boolean enabled) { @@ -3818,6 +3818,7 @@ implements Configurable /** * Default strategy for passive NAT workaround (site-local * replies are replaced.) + * @since 3.6 */ public static class NatServerResolverImpl implements HostnameResolver { private FTPClient client; Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java?rev=1782545&r1=1782544&r2=1782545&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClientConfig.java Fri Feb 10 23:59:31 2017 @@ -351,6 +351,11 @@ public class FTPClientConfig this.shortMonthNames = config.shortMonthNames; } +/** + * Copy constructor + * @param config source + * @since 3.6 + */ public FTPClientConfig(FTPClientConfig config) { this.serverSystemKey = config.serverSystemKey; this.defaultDateFormatStr = config.defaultDateFormatStr; Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java?rev=1782545&r1=1782544&r2=1782545&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/pop3/POP3MessageInfo.java Fri Feb 10 23:59:31 2017 @@ -84,6 +84,9 @@ public final class POP3MessageInfo this.identifier = uid; } +/** + * @since 3.6 + */ @Override public String toString() { return "Number: " + number + ". Size: " + size + ". Id: " + identifier; Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java?rev=1782545&r1=1782544&r2=1782545&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java Fri Feb 10 23:59:31 2017 @@ -303,10 +303,16 @@ public class TFTP extends DatagramSocket return newTFTPPacket; } -// Override this to
svn commit: r1782546 - in /commons/proper/net/trunk/src: main/java/examples/ftp/ main/java/examples/mail/ main/java/org/apache/commons/net/ftp/ main/java/org/apache/commons/net/telnet/ main/java/org/a
Author: sebb Date: Sat Feb 11 00:05:41 2017 New Revision: 1782546 URL: http://svn.apache.org/viewvc?rev=1782546&view=rev Log: Checkstyle trailing spaces Modified: commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java commons/proper/net/trunk/src/main/java/examples/mail/IMAPExportMbox.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPClient.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/telnet/TelnetClient.java commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTPClient.java commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServer.java commons/proper/net/trunk/src/test/java/org/apache/commons/net/tftp/TFTPServerMain.java Modified: commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java?rev=1782546&r1=1782545&r2=1782546&view=diff == --- commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java (original) +++ commons/proper/net/trunk/src/main/java/examples/ftp/FTPClientExample.java Sat Feb 11 00:05:41 2017 @@ -414,7 +414,7 @@ __main: System.out.println(f.getRawListing()); System.out.println(f.toFormattedString(displayTimeZoneId)); } else { -System.out.println("File not found"); +System.out.println("File not found"); } } if (mlst) { Modified: commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java?rev=1782546&r1=1782545&r2=1782546&view=diff == --- commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java (original) +++ commons/proper/net/trunk/src/main/java/examples/ftp/TFTPExample.java Sat Feb 11 00:05:41 2017 @@ -175,7 +175,7 @@ public final class TFTPExample { String [] parts = hostname.split(":"); if (parts.length == 2) { -tftp.sendFile(remoteFilename, transferMode, input, parts[0], Integer.parseInt(parts[1])); +tftp.sendFile(remoteFilename, transferMode, input, parts[0], Integer.parseInt(parts[1])); } else { tftp.sendFile(remoteFilename, transferMode, input, hostname); } @@ -236,7 +236,7 @@ public final class TFTPExample { String [] parts = hostname.split(":"); if (parts.length == 2) { -tftp.receiveFile(remoteFilename, transferMode, output, parts[0], Integer.parseInt(parts[1])); +tftp.receiveFile(remoteFilename, transferMode, output, parts[0], Integer.parseInt(parts[1])); } else { tftp.receiveFile(remoteFilename, transferMode, output, hostname); } Modified: commons/proper/net/trunk/src/main/java/examples/mail/IMAPExportMbox.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/examples/mail/IMAPExportMbox.java?rev=1782546&r1=1782545&r2=1782546&view=diff == --- commons/proper/net/trunk/src/main/java/examples/mail/IMAPExportMbox.java (original) +++ commons/proper/net/trunk/src/main/java/examples/mail/IMAPExportMbox.java Sat Feb 11 00:05:41 2017 @@ -163,7 +163,7 @@ public final class IMAPExportMbox uri = URI.create(m.group(1)); // Just the scheme and auth parts uri = new URI(uri.getScheme(), uri.getAuthority(), m.group(2), null, null); } else { -throw e; +throw e; } } final String file = args[argIdx++]; Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java?rev=1782546&r1=1782545&r2=1782546&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTP.java Sat Feb 11 00:05:41 2017 @@ -371,7 +371,7 @@ public class FTP extends SocketClient } else if (isStrictReplyParsing()) {
commons-crypto git commit: CRYPTO-134 CipherByteBufferExample should not truncate the string
Repository: commons-crypto Updated Branches: refs/heads/master 85a5ea1a3 -> 9f73f2fc1 CRYPTO-134 CipherByteBufferExample should not truncate the string Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/9f73f2fc Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/9f73f2fc Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/9f73f2fc Branch: refs/heads/master Commit: 9f73f2fc1ec45d7c26cc36cd89fd5bf455d1de66 Parents: 85a5ea1 Author: Sebb Authored: Sat Feb 11 12:14:45 2017 + Committer: Sebb Committed: Sat Feb 11 12:14:45 2017 + -- src/changes/changes.xml| 1 + .../apache/commons/crypto/examples/CipherByteBufferExample.java| 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/9f73f2fc/src/changes/changes.xml -- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 1aaf861..da1df8f 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -62,6 +62,7 @@ + CipherByteBufferExample should not truncate the string Provide FAQ page. http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/9f73f2fc/src/test/java/org/apache/commons/crypto/examples/CipherByteBufferExample.java -- diff --git a/src/test/java/org/apache/commons/crypto/examples/CipherByteBufferExample.java b/src/test/java/org/apache/commons/crypto/examples/CipherByteBufferExample.java index c515461..f35ba4c 100644 --- a/src/test/java/org/apache/commons/crypto/examples/CipherByteBufferExample.java +++ b/src/test/java/org/apache/commons/crypto/examples/CipherByteBufferExample.java @@ -99,7 +99,7 @@ public class CipherByteBufferExample { */ private static String asString(ByteBuffer buffer) { final ByteBuffer copy = buffer.duplicate(); -final byte[] bytes = new byte[Math.min(copy.remaining(),50)]; +final byte[] bytes = new byte[copy.remaining()]; copy.get(bytes); return new String(bytes, StandardCharsets.UTF_8); }
svn commit: r1782606 - in /commons/proper/net/trunk: NOTICE.txt src/site/xdoc/download_net.xml
Author: sebb Date: Sat Feb 11 14:28:25 2017 New Revision: 1782606 URL: http://svn.apache.org/viewvc?rev=1782606&view=rev Log: Prepare for 3.6 RC1 Modified: commons/proper/net/trunk/NOTICE.txt commons/proper/net/trunk/src/site/xdoc/download_net.xml Modified: commons/proper/net/trunk/NOTICE.txt URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/NOTICE.txt?rev=1782606&r1=1782605&r2=1782606&view=diff == --- commons/proper/net/trunk/NOTICE.txt (original) +++ commons/proper/net/trunk/NOTICE.txt Sat Feb 11 14:28:25 2017 @@ -1,5 +1,5 @@ Apache Commons Net -Copyright 2001-2016 The Apache Software Foundation +Copyright 2001-2017 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). Modified: commons/proper/net/trunk/src/site/xdoc/download_net.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/site/xdoc/download_net.xml?rev=1782606&r1=1782605&r2=1782606&view=diff == --- commons/proper/net/trunk/src/site/xdoc/download_net.xml (original) +++ commons/proper/net/trunk/src/site/xdoc/download_net.xml Sat Feb 11 14:28:25 2017 @@ -111,32 +111,32 @@ limitations under the License. - + - commons-net-3.5-bin.tar.gz - https://www.apache.org/dist/commons/net/binaries/commons-net-3.5-bin.tar.gz.md5";>md5 - https://www.apache.org/dist/commons/net/binaries/commons-net-3.5-bin.tar.gz.asc";>pgp + commons-net-3.6-bin.tar.gz + https://www.apache.org/dist/commons/net/binaries/commons-net-3.6-bin.tar.gz.md5";>md5 + https://www.apache.org/dist/commons/net/binaries/commons-net-3.6-bin.tar.gz.asc";>pgp - commons-net-3.5-bin.zip - https://www.apache.org/dist/commons/net/binaries/commons-net-3.5-bin.zip.md5";>md5 - https://www.apache.org/dist/commons/net/binaries/commons-net-3.5-bin.zip.asc";>pgp + commons-net-3.6-bin.zip + https://www.apache.org/dist/commons/net/binaries/commons-net-3.6-bin.zip.md5";>md5 + https://www.apache.org/dist/commons/net/binaries/commons-net-3.6-bin.zip.asc";>pgp - commons-net-3.5-src.tar.gz - https://www.apache.org/dist/commons/net/source/commons-net-3.5-src.tar.gz.md5";>md5 - https://www.apache.org/dist/commons/net/source/commons-net-3.5-src.tar.gz.asc";>pgp + commons-net-3.6-src.tar.gz + https://www.apache.org/dist/commons/net/source/commons-net-3.6-src.tar.gz.md5";>md5 + https://www.apache.org/dist/commons/net/source/commons-net-3.6-src.tar.gz.asc";>pgp - commons-net-3.5-src.zip - https://www.apache.org/dist/commons/net/source/commons-net-3.5-src.zip.md5";>md5 - https://www.apache.org/dist/commons/net/source/commons-net-3.5-src.zip.asc";>pgp + commons-net-3.6-src.zip + https://www.apache.org/dist/commons/net/source/commons-net-3.6-src.zip.md5";>md5 + https://www.apache.org/dist/commons/net/source/commons-net-3.6-src.zip.asc";>pgp
svn commit: r1782607 - in /commons/proper/net/tags/NET_3_6_RC1: ./ pom.xml
Author: sebb Date: Sat Feb 11 14:29:55 2017 New Revision: 1782607 URL: http://svn.apache.org/viewvc?rev=1782607&view=rev Log: Creating NET_3_6_RC1 tag Added: commons/proper/net/tags/NET_3_6_RC1/ - copied from r1782606, commons/proper/net/trunk/ Modified: commons/proper/net/tags/NET_3_6_RC1/pom.xml Modified: commons/proper/net/tags/NET_3_6_RC1/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/net/tags/NET_3_6_RC1/pom.xml?rev=1782607&r1=1782606&r2=1782607&view=diff == --- commons/proper/net/tags/NET_3_6_RC1/pom.xml (original) +++ commons/proper/net/tags/NET_3_6_RC1/pom.xml Sat Feb 11 14:29:55 2017 @@ -27,7 +27,7 @@ 4.0.0 commons-net commons-net -3.6-SNAPSHOT +3.6 Apache Commons Net
svn commit: r18280 - /dev/commons/net/
Author: sebb Date: Sat Feb 11 15:44:43 2017 New Revision: 18280 Log: Creating dist tag NET_3_6_RC1 Added: dev/commons/net/RELEASE-NOTES.txt (with props) dev/commons/net/commons-net-3.6-bin.tar.gz (with props) dev/commons/net/commons-net-3.6-bin.tar.gz.asc dev/commons/net/commons-net-3.6-bin.tar.gz.md5 dev/commons/net/commons-net-3.6-bin.tar.gz.sha1 dev/commons/net/commons-net-3.6-bin.zip (with props) dev/commons/net/commons-net-3.6-bin.zip.asc dev/commons/net/commons-net-3.6-bin.zip.md5 dev/commons/net/commons-net-3.6-bin.zip.sha1 dev/commons/net/commons-net-3.6-src.tar.gz (with props) dev/commons/net/commons-net-3.6-src.tar.gz.asc dev/commons/net/commons-net-3.6-src.tar.gz.md5 dev/commons/net/commons-net-3.6-src.tar.gz.sha1 dev/commons/net/commons-net-3.6-src.zip (with props) dev/commons/net/commons-net-3.6-src.zip.asc dev/commons/net/commons-net-3.6-src.zip.md5 dev/commons/net/commons-net-3.6-src.zip.sha1 Added: dev/commons/net/RELEASE-NOTES.txt == --- dev/commons/net/RELEASE-NOTES.txt (added) +++ dev/commons/net/RELEASE-NOTES.txt Sat Feb 11 15:44:43 2017 @@ -0,0 +1,59 @@ + Apache Commons Net 3.6 + RELEASE NOTES + +The Apache Commons Net team is pleased to announce the release of Apache Commons Net 3.6 + +Apache Commons Net library contains a collection of network utilities and protocol implementations. +Supported protocols include: Echo, Finger, FTP, NNTP, NTP, POP3(S), SMTP(S), Telnet, Whois + +This is mainly a bug-fix release. See further details below. + +This release is binary compatible with previous releases. +However it is not source compatible with releases before 3.4, as some methods were added to the interface NtpV3Packet in 3.4 + +The code now requires a minimum of Java 1.6. + +Changes to functionality: +* The FTP client now performs stricter checks on non-multiline command replies. + The 3 digit code must now be followed by a space and some text, as per RFC 959. + To suppress this stricter checking, call FTP#setStrictReplyParsing(false). This should not be needed with a well-behaved server. + Note also that if strict checking is disabled, some functions may unconditionally strip the next character after the code, without checking it if is a space. +* The FTP client mlistFile() method now checks for a leading space before removing it. + If the space is missing, a MalformedServerReplyException is thrown. + This will only happen if the FTP server is not compliant with RFC 3659. + +Notable additions: +* The POP3Mail examples can now get password from console, stdin or an environment variable. +* TFTPClient code has been rewritten to improve error handling and retries. + +Changes in this version include: + +Fixed Bugs: +o NET-613: TFTPClient assumes that lastBlock == 0 only once +o NET-320: Allow TFTPServer.java to bind to a specific network adapter Thanks to Kevin Bulebush. +o NET-414: Apache Commons TFTP does not reject request replies that originate from a control port. Thanks to Chuck Wolber. +o NET-477: TFTP sendFile retry broken Thanks to John Walton. +o NET-596: NullPointerException when disconnecting TelnetClient twice with JDK 7 Thanks to Vincent Bories-Azeau. +o NET-602: Failure to parse times from SYST_L8 systems that report as "WINDOWS Type: L8" Thanks to Ross Braithwaite. +o NET-604: TFTP send and receive don't have progress indication Thanks to Frank Delporte. +o NET-588: FTPClient.setPassiveNatWorkaround assumes host is outside site local range Thanks to Dave Nice / Thai H. +o NET-610: FTPClient.mlistFile incorrectly handles MLST reply Thanks to Sergey Yanzin. +o NET-611: FTP does not validate command reply syntax fully +o NET-609: DefaultUnixFTPFileEntryParserFactory Issue (leading spaces removal configuration) Thanks to Tqup3. +o NET-597: FTP fails to parse listings for Solaris 10 FTPd in Japanese Thanks to Hiroki Taniura. +o NET-593: HostnameVerifier is called with ip addess instead of the provided hostname Thanks to Jörg Weule. +o NET-594: TelnetClient._closeOutputStream unhandled exception from FilterOutputStream.close Thanks to Brad Worrral. +o NET-592: plainSocket in FTPSClient is never closed Thanks to Mark Ford. + +Changes: +o NET-612: Allow TFTP socket IO tracing +o POP3Mail example: support host port; allow reading password from Console/stdin/environment +o NET-599: Add shorthand FTPClientConfig constructor + + +Historical list of changes: http://commons.apache.org/proper/commons-net/changes-report.html + +For complete information on Apache Commons Net, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Apache Commons Net website: + +http://commons.apache.org/proper/commons-net/ Propchange: dev/commons/net/RE
svn commit: r1782624 - /commons/proper/validator/trunk/src/changes/changes.xml
Author: sebb Date: Sat Feb 11 17:08:10 2017 New Revision: 1782624 URL: http://svn.apache.org/viewvc?rev=1782624&view=rev Log: Fix XML syntax Modified: commons/proper/validator/trunk/src/changes/changes.xml Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1782624&r1=1782623&r2=1782624&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Sat Feb 11 17:08:10 2017 @@ -96,10 +96,10 @@ http://commons.apache.org/validator/depe CodeValidator unconditionally trim()s the input string - document the behaviour -> + Userinfo without colon should be valid in UrlValidator -> + General Modulus Ten Check Digit Implementation
svn commit: r1782625 - /commons/proper/validator/trunk/pom.xml
Author: sebb Date: Sat Feb 11 17:08:36 2017 New Revision: 1782625 URL: http://svn.apache.org/viewvc?rev=1782625&view=rev Log: Latest CP Modified: commons/proper/validator/trunk/pom.xml Modified: commons/proper/validator/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/pom.xml?rev=1782625&r1=1782624&r2=1782625&view=diff == --- commons/proper/validator/trunk/pom.xml (original) +++ commons/proper/validator/trunk/pom.xml Sat Feb 11 17:08:36 2017 @@ -20,7 +20,7 @@ org.apache.commons commons-parent -40 +42 4.0.0 commons-validator @@ -284,7 +284,7 @@ maven-pmd-plugin -3.5 +3.7 ${maven.compiler.target} @@ -300,7 +300,7 @@ org.codehaus.mojo findbugs-maven-plugin -3.0.2 +3.0.4 Normal Default
svn commit: r1782626 - /commons/proper/validator/trunk/src/site/site.xml
Author: sebb Date: Sat Feb 11 17:13:16 2017 New Revision: 1782626 URL: http://svn.apache.org/viewvc?rev=1782626&view=rev Log: Drop historic Javadocs Modified: commons/proper/validator/trunk/src/site/site.xml Modified: commons/proper/validator/trunk/src/site/site.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/site/site.xml?rev=1782626&r1=1782625&r2=1782626&view=diff == --- commons/proper/validator/trunk/src/site/site.xml (original) +++ commons/proper/validator/trunk/src/site/site.xml Sat Feb 11 17:13:16 2017 @@ -38,18 +38,6 @@ http://wiki.apache.org/commons/Validator"/> - - - - - - - - - - - -
svn commit: r1782636 - in /commons/proper/validator/trunk: CONTRIBUTING.md README.md
Author: sebb Date: Sat Feb 11 22:00:55 2017 New Revision: 1782636 URL: http://svn.apache.org/viewvc?rev=1782636&view=rev Log: EOL Modified: commons/proper/validator/trunk/CONTRIBUTING.md (props changed) commons/proper/validator/trunk/README.md (props changed) Propchange: commons/proper/validator/trunk/CONTRIBUTING.md -- svn:eol-style = native Propchange: commons/proper/validator/trunk/README.md -- svn:eol-style = native
svn commit: r1782637 - in /commons/proper/commons-build-plugin/trunk: CONTRIBUTING.md README.md src/main/resources/commons-xdoc-templates/contributing-md-template.md
Author: sebb Date: Sat Feb 11 22:05:34 2017 New Revision: 1782637 URL: http://svn.apache.org/viewvc?rev=1782637&view=rev Log: EOL needed to ensure generated files have the correct EOLs Modified: commons/proper/commons-build-plugin/trunk/CONTRIBUTING.md (props changed) commons/proper/commons-build-plugin/trunk/README.md (props changed) commons/proper/commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates/contributing-md-template.md (props changed) Propchange: commons/proper/commons-build-plugin/trunk/CONTRIBUTING.md -- svn:eol-style = native Propchange: commons/proper/commons-build-plugin/trunk/README.md -- svn:eol-style = native Propchange: commons/proper/commons-build-plugin/trunk/src/main/resources/commons-xdoc-templates/contributing-md-template.md -- svn:eol-style = native
svn commit: r1782638 - in /commons/proper/commons-build-plugin/trunk: RELEASE-NOTES.txt src/changes/changes.xml
Author: sebb Date: Sat Feb 11 22:10:25 2017 New Revision: 1782638 URL: http://svn.apache.org/viewvc?rev=1782638&view=rev Log: Minor fix to sort out EOLs Modified: commons/proper/commons-build-plugin/trunk/RELEASE-NOTES.txt commons/proper/commons-build-plugin/trunk/src/changes/changes.xml Modified: commons/proper/commons-build-plugin/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/commons-build-plugin/trunk/RELEASE-NOTES.txt?rev=1782638&r1=1782637&r2=1782638&view=diff == --- commons/proper/commons-build-plugin/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/commons-build-plugin/trunk/RELEASE-NOTES.txt Sat Feb 11 22:10:25 2017 @@ -10,6 +10,12 @@ See: http://commons.apache.org/commons-build-plugin/ +VERSION 1.8 - 2017-MM-DD + + +Changes since the last release +1. Fix EOL-style so generate files have correct setting + VERSION 1.7 - 2016-11-18 Modified: commons/proper/commons-build-plugin/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/commons-build-plugin/trunk/src/changes/changes.xml?rev=1782638&r1=1782637&r2=1782638&view=diff == --- commons/proper/commons-build-plugin/trunk/src/changes/changes.xml (original) +++ commons/proper/commons-build-plugin/trunk/src/changes/changes.xml Sat Feb 11 22:10:25 2017 @@ -25,8 +25,12 @@ - - + + +Add eol-style:native otherwise generated files can cause commit errors + + + Include badges in the README.md file.
svn commit: r1782639 - /commons/proper/commons-build-plugin/trunk/NOTICE.txt
Author: sebb Date: Sat Feb 11 22:10:49 2017 New Revision: 1782639 URL: http://svn.apache.org/viewvc?rev=1782639&view=rev Log: New Year Modified: commons/proper/commons-build-plugin/trunk/NOTICE.txt Modified: commons/proper/commons-build-plugin/trunk/NOTICE.txt URL: http://svn.apache.org/viewvc/commons/proper/commons-build-plugin/trunk/NOTICE.txt?rev=1782639&r1=1782638&r2=1782639&view=diff == --- commons/proper/commons-build-plugin/trunk/NOTICE.txt (original) +++ commons/proper/commons-build-plugin/trunk/NOTICE.txt Sat Feb 11 22:10:49 2017 @@ -1,5 +1,5 @@ Apache Commons Build Plugin -Copyright 2008-2016 The Apache Software Foundation +Copyright 2008-2017 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/).
svn commit: r1782640 - /commons/proper/validator/trunk/NOTICE.txt
Author: sebb Date: Sat Feb 11 22:11:51 2017 New Revision: 1782640 URL: http://svn.apache.org/viewvc?rev=1782640&view=rev Log: New Year Modified: commons/proper/validator/trunk/NOTICE.txt Modified: commons/proper/validator/trunk/NOTICE.txt URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/NOTICE.txt?rev=1782640&r1=1782639&r2=1782640&view=diff == --- commons/proper/validator/trunk/NOTICE.txt (original) +++ commons/proper/validator/trunk/NOTICE.txt Sat Feb 11 22:11:51 2017 @@ -1,5 +1,5 @@ Apache Commons Validator -Copyright 2001-2016 The Apache Software Foundation +Copyright 2001-2017 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/).
svn commit: r1782641 - in /commons/proper/validator/trunk: RELEASE-NOTES.txt pom.xml src/site/xdoc/download_validator.xml
Author: sebb Date: Sat Feb 11 22:14:22 2017 New Revision: 1782641 URL: http://svn.apache.org/viewvc?rev=1782641&view=rev Log: Recent changes Modified: commons/proper/validator/trunk/RELEASE-NOTES.txt commons/proper/validator/trunk/pom.xml commons/proper/validator/trunk/src/site/xdoc/download_validator.xml Modified: commons/proper/validator/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/RELEASE-NOTES.txt?rev=1782641&r1=1782640&r2=1782641&view=diff == --- commons/proper/validator/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/validator/trunk/RELEASE-NOTES.txt Sat Feb 11 22:14:22 2017 @@ -1,8 +1,7 @@ - Apache Commons Validator - Version 1.5.1 - RELEASE NOTES + Apache Commons Validator 1.5.2 + RELEASE NOTES -The Apache Commons Validator team is pleased to announce the release of Apache Commons Validator 1.5.1 +The Apache Commons Validator team is pleased to announce the release of Apache Commons Validator 1.5.2 Apache Commons Validator provides the building blocks for both client side validation and server side data validation. It may be used standalone or with a framework like Struts. @@ -27,20 +26,27 @@ For the current list of dependencies, pl Changes in this version include: New features: -o VALIDATOR-351: DomainValidator - allow access to internal arrays +o VALIDATOR-413: Generic CreditCard validation +o VALIDATOR-394: General Modulus Ten Check Digit Implementation Thanks to Niall Pemberton. Fixed Bugs: -o VALIDATOR-392: Mastercard Series 2 BIN ranges (active from October 2016) added to CreditCardValidator - To disable the new ranges, use option MASTERCARD_PRE_OCT2016 or validator MASTERCARD_VALIDATOR_PRE_OCT2016 Thanks to Tim Deboer. -o VALIDATOR-386: org.apache.commons.validator.routines.DomainValidator.ArrayType is not public Thanks to Auke van Leeuwen. -o VALIDATOR-359: EmailValidator does not catch invalid email address like dora@.com Thanks to Dora Kinghorn. -o VALIDATOR-384: EmailValidator does not support escaped quotes in a quoted string Thanks to Kris Babic. +o VALIDATOR-379: CodeValidator unconditionally trim()s the input string - document the behaviour +o VALIDATOR-387: Userinfo without colon should be valid in UrlValidator Thanks to Shumpei Akai. +o VALIDATOR-411: UrlValidator accepts ports above max limit of 16-bit unsigned integer +o VALIDATOR-407: Generic .shop top level domain is considered invalid +o VALIDATOR-405: IBANValidator - Costa Rica entry has been updated in SWIFT docs +o VALIDATOR-401: IBANValidator fails for Seychelles and Ukraine +o VALIDATOR-391: UrlValidator.isValid throws exception for FILEURLs + Fixed code so it handles URLs with no authority field Thanks to Mark E. Scott, Jr. & Jason Loomis. Changes: -o Updated to TLD list Version 2016041301, Last Updated Thu Apr 14 07:07:01 2016 UTC +o IANA TLD lists: Updated to Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC +o Update to version 73 of SWIFT IBAN list: added BY (Belarus) and IQ (Iraq); fixed Santa Lucia format +Historical list of changes: http://commons.apache.org/proper/commons-validator/changes-report.html + For complete information on Apache Commons Validator, including instructions on how to submit bug reports, patches, or suggestions for improvement, see the Apache Apache Commons Validator website: -http://commons.apache.org/proper/commons-validator/ \ No newline at end of file +http://commons.apache.org/proper/commons-validator/ Modified: commons/proper/validator/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/pom.xml?rev=1782641&r1=1782640&r2=1782641&view=diff == --- commons/proper/validator/trunk/pom.xml (original) +++ commons/proper/validator/trunk/pom.xml Sat Feb 11 22:14:22 2017 @@ -140,8 +140,8 @@ validator -1.5.1 -RC2 +1.5.2 +RC1 (requires JDK ${maven.compiler.target}) 1.4.1 (requires JDK 1.4) Modified: commons/proper/validator/trunk/src/site/xdoc/download_validator.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/site/xdoc/download_validator.xml?rev=1782641&r1=1782640&r2=1782641&view=diff == --- commons/proper/validator/trunk/src/site/xdoc/download_validator.xml (original) +++ commons/proper/validator/trunk/src/site/xdoc/download_validator.xml Sat Feb 11 22:14:22 2017 @@ -31,10 +31,21 @@ limitations under the License. | 2) Set the following properties in the component's pom: | |- comm
svn commit: r1782666 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java
Author: sebb Date: Sun Feb 12 13:51:38 2017 New Revision: 1782666 URL: http://svn.apache.org/viewvc?rev=1782666&view=rev Log: Javadoc Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=1782666&r1=1782665&r2=1782666&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Sun Feb 12 13:51:38 2017 @@ -257,17 +257,21 @@ public class CreditCardValidator impleme /** * Create a new generic CreditCardValidator which validates the syntax and check digit only. + * Does not check the Issuer Identification Number (IIN) + * * @param minLen minimum allowed length * @param maxLen maximum allowed length * @return the validator * @since 1.5.2 */ public static CreditCardValidator genericCreditCardValidator(int minLen, int maxLen) { -return new CreditCardValidator(new CodeValidator[] {new CodeValidator("(\\d+)", minLen, maxLen, LuhnCheckDigit.LUHN_CHECK_DIGIT)}); +return new CreditCardValidator(new CodeValidator[] {new CodeValidator("(\\d+)", minLen, maxLen, LUHN_VALIDATOR)}); } /** * Create a new generic CreditCardValidator which validates the syntax and check digit only. + * Does not check the Issuer Identification Number (IIN) + * * @param length exact length * @return the validator * @since 1.5.2 @@ -278,6 +282,8 @@ public class CreditCardValidator impleme /** * Create a new generic CreditCardValidator which validates the syntax and check digit only. + * Does not check the Issuer Identification Number (IIN) + * * @return the validator * @since 1.5.2 */
svn commit: r1782688 - in /commons/proper/validator/trunk/src: changes/changes.xml main/java/org/apache/commons/validator/routines/CreditCardValidator.java test/java/org/apache/commons/validator/routi
Author: sebb Date: Sun Feb 12 18:27:04 2017 New Revision: 1782688 URL: http://svn.apache.org/viewvc?rev=1782688&view=rev Log: VALIDATOR-415 Simplify building new CreditCard validators Modified: commons/proper/validator/trunk/src/changes/changes.xml commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1782688&r1=1782687&r2=1782688&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Sun Feb 12 18:27:04 2017 @@ -65,13 +65,21 @@ The type attribute can be add,u http://commons.apache.org/validator/dependencies.html "> + +Simplify building new CreditCard validators + Generic CreditCard validation Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=1782688&r1=1782687&r2=1782688&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Sun Feb 12 18:27:04 2017 @@ -38,14 +38,40 @@ import java.util.ArrayList; * * * configures the validator to only pass American Express and Visa cards. - * If a card type is not directly supported by this class, you can implement - * the CreditCardType interface and pass an instance into the - * addAllowedCardType method. + * If a card type is not directly supported by this class, you can create an + * instance of the {@link CodeValidator} class and pass it to a {@link CreditCardValidator} + * constructor along with any existing validators. For example: * * + * + * CreditCardValidator ccv = new CreditCardValidator( + * new CodeValidator[] { + * CreditCardValidator.AMEX_VALIDATOR, + * CreditCardValidator.VISA_VALIDATOR, + * new CodeValidator("^(4)(\\d{12,18})$", LUHN_VALIDATOR) // add VPAY + * }; + * + * + * + * Alternatively you can define a validator using the {@link CreditCardRange} class. + * For example: + * + * + * + * CreditCardValidator ccv = new CreditCardValidator( + *new CreditCardRange[]{ + *new CreditCardRange("300", "305", 14, 14), // Diners + *new CreditCardRange("3095", null, 14, 14), // Diners + *new CreditCardRange("36", null, 14, 14), // Diners + *new CreditCardRange("38", "39", 14, 14), // Diners + *} + * ); + * + * + * + * This can be combined with a list of {@code CodeValidator}s + * * - * For a similar implementation in Perl, reference Sean M. Burke's - * http://www.speech.cs.cmu.edu/~sburke/pub/luhn_lib.html";>script. * More information can be found in Michael Gilleland's essay * http://web.archive.org/web/20120614072656/http://www.merriampark.com/anatomycc.htm";>Anatomy of Credit Card Numbers. * @@ -62,6 +88,38 @@ public class CreditCardValidator impleme private static final int MAX_CC_LENGTH = 19; // maximum allowed length /** + * Class that represents a credit card range. + */ +public static class CreditCardRange { +final String low; // e.g. 34 or 644 +final String high; // e.g. 34 or 65 +final int minLen; // e.g. 16 +final int maxLen; // e.g. 19 + +/** + * Create a credit card range specifier for use in validation + * of the number syntax including the IIN range. + * + * The low and high parameters may be shorter than the length + * of an IIN (currently 6 digits) in which case subsequent digits + * are ignored and may range from 0-9. + * + * The low and high parameters may be different lengths. + * e.g. Discover "644" and "65". + * @param low the low digits of the IIN range + * @param high the high digits of the IIN range + * @param minLen the minimum length of the entire number + * @param maxLen the maximum length of the entire number + */ +public CreditCardRange(String low, String high, int minLen, int maxLen) { +this.low = low; +this.high = high; +this.
svn commit: r1782740 - in /commons/proper/validator/trunk/src: main/java/org/apache/commons/validator/routines/CreditCardValidator.java test/java/org/apache/commons/validator/routines/CreditCardValida
Author: sebb Date: Mon Feb 13 10:55:52 2017 New Revision: 1782740 URL: http://svn.apache.org/viewvc?rev=1782740&view=rev Log: VALIDATOR-415 Extend syntax to allow disjoint lengths Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java?rev=1782740&r1=1782739&r2=1782740&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/CreditCardValidator.java Mon Feb 13 10:55:52 2017 @@ -64,6 +64,7 @@ import java.util.ArrayList; *new CreditCardRange("3095", null, 14, 14), // Diners *new CreditCardRange("36", null, 14, 14), // Diners *new CreditCardRange("38", "39", 14, 14), // Diners + *new CreditCardRange("4",null, new int[] {13, 16}), // VISA *} * ); * @@ -88,13 +89,15 @@ public class CreditCardValidator impleme private static final int MAX_CC_LENGTH = 19; // maximum allowed length /** - * Class that represents a credit card range. + * Class that represents a credit card range. + * @since 1.6 */ public static class CreditCardRange { final String low; // e.g. 34 or 644 final String high; // e.g. 34 or 65 -final int minLen; // e.g. 16 -final int maxLen; // e.g. 19 +final int minLen; // e.g. 16 or -1 +final int maxLen; // e.g. 19 or -1 +final int lengths[]; // e.g. 16,18,19 /** * Create a credit card range specifier for use in validation @@ -117,6 +120,30 @@ public class CreditCardValidator impleme this.high = high; this.minLen = minLen; this.maxLen = maxLen; +this.lengths = null; +} + +/** + * Create a credit card range specifier for use in validation + * of the number syntax including the IIN range. + * + * The low and high parameters may be shorter than the length + * of an IIN (currently 6 digits) in which case subsequent digits + * are ignored and may range from 0-9. + * + * The low and high parameters may be different lengths. + * e.g. Discover "644" and "65". + * + * @param low the low digits of the IIN range + * @param high the high digits of the IIN range + * @param lengths array of valid lengths + */ +public CreditCardRange(String low, String high, int [] lengths) { +this.low = low; +this.high = high; +this.minLen = -1; +this.maxLen = -1; +this.lengths = lengths.clone(); } } @@ -422,6 +449,19 @@ public class CreditCardValidator impleme } // package protected for unit test access +static boolean validLength(int valueLength, CreditCardRange range) { +if (range.lengths != null) { +for(int length : range.lengths) { +if (valueLength == length) { +return true; +} +} +return false; +} +return valueLength >= range.minLen && valueLength <= range.maxLen; +} + +// package protected for unit test access static CodeValidator createRangeValidator(final CreditCardRange[] creditCardRanges, final CheckDigit digitCheck ) { return new CodeValidator( // must be numeric (rest of validation is done later) @@ -434,7 +474,7 @@ public class CreditCardValidator impleme if (super.match(value) != null) { int length = value.length(); for(CreditCardRange range : ccr) { -if (length >= range.minLen && length <= range.maxLen) { +if (validLength(length, range)) { if (range.high == null) { // single prefix only if (value.startsWith(range.low)) { return value; Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/CreditCardValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/j
svn commit: r1782756 - /commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IntegerValidator.java
Author: sebb Date: Mon Feb 13 11:54:26 2017 New Revision: 1782756 URL: http://svn.apache.org/viewvc?rev=1782756&view=rev Log: More efficient to use valueOf (Findbugs) Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IntegerValidator.java Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IntegerValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IntegerValidator.java?rev=1782756&r1=1782755&r2=1782756&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IntegerValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/IntegerValidator.java Mon Feb 13 11:54:26 2017 @@ -250,6 +250,6 @@ public class IntegerValidator extends Ab longValue > Integer.MAX_VALUE) { return null; } -return new Integer((int)longValue); +return Integer.valueOf((int)longValue); } }
svn commit: r1783032 - in /commons/proper/validator/trunk: ./ src/changes/ src/main/java/org/apache/commons/validator/routines/ src/test/java/org/apache/commons/validator/routines/
Author: sebb Date: Tue Feb 14 21:27:58 2017 New Revision: 1783032 URL: http://svn.apache.org/viewvc?rev=1783032&view=rev Log: VALIDATOR-419 Invalid IPv6 addresses that are IPv4-mapped pass InetAddressValidator validation Modified: commons/proper/validator/trunk/RELEASE-NOTES.txt commons/proper/validator/trunk/src/changes/changes.xml commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/InetAddressValidatorTest.java Modified: commons/proper/validator/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/RELEASE-NOTES.txt?rev=1783032&r1=1783031&r2=1783032&view=diff == --- commons/proper/validator/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/validator/trunk/RELEASE-NOTES.txt Tue Feb 14 21:27:58 2017 @@ -6,12 +6,15 @@ The Apache Commons Validator team is ple Apache Commons Validator provides the building blocks for both client side validation and server side data validation. It may be used standalone or with a framework like Struts. -This is a maintenance release. +This is primarily a maintenance release. All projects are encouraged to update to this release of Apache Commons Validator. Commons Validator requires Java 1.6 or later. - -IMPORTANT NOTES +Main enhancements = +* Modulus Ten Check Digit Implementation +* Generic CreditCard validation (syntax and checkdigit only; does not check IIN) +* CreditCard validation specification by numeric range + IMPORTANT NOTES === BREAKING CHANGES: @@ -26,10 +29,13 @@ For the current list of dependencies, pl Changes in this version include: New features: +o VALIDATOR-415: Simplify building new CreditCard validators o VALIDATOR-413: Generic CreditCard validation o VALIDATOR-394: General Modulus Ten Check Digit Implementation Thanks to Niall Pemberton. Fixed Bugs: +o VALIDATOR-419: Invalid IPv6 addresses that are IPv4-mapped pass InetAddressValidator validation Thanks to Denis Iskhakov. +o VALIDATOR-418: UrlValidatorTest: testIsValid() does not run all tests Thanks to Robert McGuigan. o VALIDATOR-379: CodeValidator unconditionally trim()s the input string - document the behaviour o VALIDATOR-387: Userinfo without colon should be valid in UrlValidator Thanks to Shumpei Akai. o VALIDATOR-411: UrlValidator accepts ports above max limit of 16-bit unsigned integer @@ -38,7 +44,6 @@ o VALIDATOR-405: IBANValidator - Costa o VALIDATOR-401: IBANValidator fails for Seychelles and Ukraine o VALIDATOR-391: UrlValidator.isValid throws exception for FILEURLs Fixed code so it handles URLs with no authority field Thanks to Mark E. Scott, Jr. & Jason Loomis. -o VALIDATOR-418: UrlValidatorTest: testIsValid() does not run all tests. Thanks to Robert McGuigan Changes: o IANA TLD lists: Updated to Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1783032&r1=1783031&r2=1783032&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Tue Feb 14 21:27:58 2017 @@ -98,6 +98,9 @@ The dependencies for Validator have not For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html "> + +Invalid IPv6 addresses that are IPv4-mapped pass InetAddressValidator validation + UrlValidatorTest: testIsValid() does not run all tests Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java?rev=1783032&r1=1783031&r2=1783032&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/InetAddressValidator.java Tue Feb 14 21:27:58 2017 @@ -149,7 +149,7 @@ public class InetAddressValidator implem return false; } int validOctets = 0; -int emptyOctets = 0; +int emptyOctets = 0; // consecutive empty chunks for (int index = 0; index < octets.length; index++) { String octet = octets[index]; if (octet.length() == 0) { @@ -15
svn commit: r18335 - /dev/commons/net/ /release/commons/net/ /release/commons/net/binaries/ /release/commons/net/source/
Author: sebb Date: Tue Feb 14 22:07:04 2017 New Revision: 18335 Log: Release NET 3.6 Added: release/commons/net/RELEASE-NOTES.txt - copied unchanged from r18334, dev/commons/net/RELEASE-NOTES.txt release/commons/net/binaries/commons-net-3.6-bin.tar.gz - copied unchanged from r18334, dev/commons/net/commons-net-3.6-bin.tar.gz release/commons/net/binaries/commons-net-3.6-bin.tar.gz.asc - copied unchanged from r18334, dev/commons/net/commons-net-3.6-bin.tar.gz.asc release/commons/net/binaries/commons-net-3.6-bin.tar.gz.md5 - copied unchanged from r18334, dev/commons/net/commons-net-3.6-bin.tar.gz.md5 release/commons/net/binaries/commons-net-3.6-bin.tar.gz.sha1 - copied unchanged from r18334, dev/commons/net/commons-net-3.6-bin.tar.gz.sha1 release/commons/net/binaries/commons-net-3.6-bin.zip - copied unchanged from r18334, dev/commons/net/commons-net-3.6-bin.zip release/commons/net/binaries/commons-net-3.6-bin.zip.asc - copied unchanged from r18334, dev/commons/net/commons-net-3.6-bin.zip.asc release/commons/net/binaries/commons-net-3.6-bin.zip.md5 - copied unchanged from r18334, dev/commons/net/commons-net-3.6-bin.zip.md5 release/commons/net/binaries/commons-net-3.6-bin.zip.sha1 - copied unchanged from r18334, dev/commons/net/commons-net-3.6-bin.zip.sha1 release/commons/net/source/commons-net-3.6-src.tar.gz - copied unchanged from r18334, dev/commons/net/commons-net-3.6-src.tar.gz release/commons/net/source/commons-net-3.6-src.tar.gz.asc - copied unchanged from r18334, dev/commons/net/commons-net-3.6-src.tar.gz.asc release/commons/net/source/commons-net-3.6-src.tar.gz.md5 - copied unchanged from r18334, dev/commons/net/commons-net-3.6-src.tar.gz.md5 release/commons/net/source/commons-net-3.6-src.tar.gz.sha1 - copied unchanged from r18334, dev/commons/net/commons-net-3.6-src.tar.gz.sha1 release/commons/net/source/commons-net-3.6-src.zip - copied unchanged from r18334, dev/commons/net/commons-net-3.6-src.zip release/commons/net/source/commons-net-3.6-src.zip.asc - copied unchanged from r18334, dev/commons/net/commons-net-3.6-src.zip.asc release/commons/net/source/commons-net-3.6-src.zip.md5 - copied unchanged from r18334, dev/commons/net/commons-net-3.6-src.zip.md5 release/commons/net/source/commons-net-3.6-src.zip.sha1 - copied unchanged from r18334, dev/commons/net/commons-net-3.6-src.zip.sha1 Removed: dev/commons/net/RELEASE-NOTES.txt dev/commons/net/commons-net-3.6-bin.tar.gz dev/commons/net/commons-net-3.6-bin.tar.gz.asc dev/commons/net/commons-net-3.6-bin.tar.gz.md5 dev/commons/net/commons-net-3.6-bin.tar.gz.sha1 dev/commons/net/commons-net-3.6-bin.zip dev/commons/net/commons-net-3.6-bin.zip.asc dev/commons/net/commons-net-3.6-bin.zip.md5 dev/commons/net/commons-net-3.6-bin.zip.sha1 dev/commons/net/commons-net-3.6-src.tar.gz dev/commons/net/commons-net-3.6-src.tar.gz.asc dev/commons/net/commons-net-3.6-src.tar.gz.md5 dev/commons/net/commons-net-3.6-src.tar.gz.sha1 dev/commons/net/commons-net-3.6-src.zip dev/commons/net/commons-net-3.6-src.zip.asc dev/commons/net/commons-net-3.6-src.zip.md5 dev/commons/net/commons-net-3.6-src.zip.sha1
svn commit: r18336 - /release/commons/net/README.html
Author: sebb Date: Tue Feb 14 22:10:10 2017 New Revision: 18336 Log: 3.6 Modified: release/commons/net/README.html Modified: release/commons/net/README.html == --- release/commons/net/README.html (original) +++ release/commons/net/README.html Tue Feb 14 22:10:10 2017 @@ -1,6 +1,6 @@ -Apache Commons Net 3.5 +Apache Commons Net 3.6 -This is the 3.5 version of Apache Commons Net. It is available in both binary and source distributions. +This is the 3.6 version of Apache Commons Net. It is available in both binary and source distributions. Note: @@ -40,13 +40,13 @@ HREF="http://www.apache.org/dist/commons Always test available signatures, e.g., $ pgpk -a KEYS -$ pgpv commons-net-3.5-bin.tar.gz.asc +$ pgpv commons-net-3.6-bin.tar.gz.asc or, $ pgp -ka KEYS -$ pgp commons-net-3.5-bin.tar.gz.asc +$ pgp commons-net-3.6-bin.tar.gz.asc or, $ gpg --import KEYS -$ gpg --verify commons-net-3.5-bin.tar.gz.asc +$ gpg --verify commons-net-3.6-bin.tar.gz.asc
svn commit: r1783039 - in /commons/proper/net/trunk: pom.xml src/changes/changes.xml
Author: sebb Date: Tue Feb 14 22:16:44 2017 New Revision: 1783039 URL: http://svn.apache.org/viewvc?rev=1783039&view=rev Log: 3.6 vote passed Modified: commons/proper/net/trunk/pom.xml commons/proper/net/trunk/src/changes/changes.xml Modified: commons/proper/net/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/pom.xml?rev=1783039&r1=1783038&r2=1783039&view=diff == --- commons/proper/net/trunk/pom.xml (original) +++ commons/proper/net/trunk/pom.xml Tue Feb 14 22:16:44 2017 @@ -27,7 +27,7 @@ 4.0.0 commons-net commons-net -3.6-SNAPSHOT +3.7-SNAPSHOT Apache Commons Net -
svn commit: r1783042 - /commons/cms-site/trunk/content/xdoc/site-publish.xml
Author: sebb Date: Tue Feb 14 22:36:43 2017 New Revision: 1783042 URL: http://svn.apache.org/viewvc?rev=1783042&view=rev Log: Don't need to make cgis executable any more Modified: commons/cms-site/trunk/content/xdoc/site-publish.xml Modified: commons/cms-site/trunk/content/xdoc/site-publish.xml URL: http://svn.apache.org/viewvc/commons/cms-site/trunk/content/xdoc/site-publish.xml?rev=1783042&r1=1783041&r2=1783042&view=diff == --- commons/cms-site/trunk/content/xdoc/site-publish.xml (original) +++ commons/cms-site/trunk/content/xdoc/site-publish.xml Tue Feb 14 22:36:43 2017 @@ -78,12 +78,6 @@ The site can also be built locally and checked into the appropriate location manually. - - Please remember to check that the download_xyz.cgi script has the property "svn:executable *", otherwise downloads will fail. - - Note: the following command can be used on people/minotaur to check the Commons CGI script permissions: - -find /www/commons.apache.org -name "*.cgi" ! -perm -111 -ls Default deployment targets are: @@ -97,15 +91,15 @@ The maven-scm-publish-plugin will delete any content not generated by the Maven site plugin. To avoid deletion of previous apis javadocs or other static content, the pom needs some configuration: + org.apache.maven.plugins + maven-scm-publish-plugin + + + javadocs + + + +]]> All declared paths won't be deleted from svn but rather have to be imported manually.
svn commit: r1783047 - in /commons/proper/net/trunk: pom.xml src/site/site.xml
Author: sebb Date: Tue Feb 14 23:53:07 2017 New Revision: 1783047 URL: http://svn.apache.org/viewvc?rev=1783047&view=rev Log: About time to drop 1.4.1 from download page Modified: commons/proper/net/trunk/pom.xml commons/proper/net/trunk/src/site/site.xml Modified: commons/proper/net/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/pom.xml?rev=1783047&r1=1783046&r2=1783047&view=diff == --- commons/proper/net/trunk/pom.xml (original) +++ commons/proper/net/trunk/pom.xml Tue Feb 14 23:53:07 2017 @@ -181,12 +181,6 @@ Supported protocols include: Echo, Finge RC1 (Requires Java ${maven.compiler.target} or later) - -1.4.1 - - -(Requires Java 1.3 or later) - 2.17 6.9 Modified: commons/proper/net/trunk/src/site/site.xml URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/site/site.xml?rev=1783047&r1=1783046&r2=1783047&view=diff == --- commons/proper/net/trunk/src/site/site.xml (original) +++ commons/proper/net/trunk/src/site/site.xml Tue Feb 14 23:53:07 2017 @@ -30,8 +30,7 @@ - - +
svn commit: r1783048 - /commons/proper/net/tags/NET_3_6/
Author: sebb Date: Tue Feb 14 23:59:38 2017 New Revision: 1783048 URL: http://svn.apache.org/viewvc?rev=1783048&view=rev Log: 3.6 GA Added: commons/proper/net/tags/NET_3_6/ - copied from r1783047, commons/proper/net/tags/NET_3_6_RC1/
svn commit: r1783113 - in /commons/cms-site/trunk: conf/component_releases.properties doap/doap_net.rdf
Author: sebb Date: Wed Feb 15 15:21:49 2017 New Revision: 1783113 URL: http://svn.apache.org/viewvc?rev=1783113&view=rev Log: NET 3.6 GA Modified: commons/cms-site/trunk/conf/component_releases.properties commons/cms-site/trunk/doap/doap_net.rdf Modified: commons/cms-site/trunk/conf/component_releases.properties URL: http://svn.apache.org/viewvc/commons/cms-site/trunk/conf/component_releases.properties?rev=1783113&r1=1783112&r2=1783113&view=diff == --- commons/cms-site/trunk/conf/component_releases.properties (original) +++ commons/cms-site/trunk/conf/component_releases.properties Wed Feb 15 15:21:49 2017 @@ -62,8 +62,8 @@ mathVersion=3.5 mathReleased=2015-04-17 modelerVersion=2.0.1 modelerReleased=2007-06-25 -netVersion=3.5 -netReleased=2016-05-05 +netVersion=3.6 +netReleased=2017-02-15 ognlVersion=4.0 ognlReleased=2013-??-?? poolVersion=2.4.2 Modified: commons/cms-site/trunk/doap/doap_net.rdf URL: http://svn.apache.org/viewvc/commons/cms-site/trunk/doap/doap_net.rdf?rev=1783113&r1=1783112&r2=1783113&view=diff == --- commons/cms-site/trunk/doap/doap_net.rdf (original) +++ commons/cms-site/trunk/doap/doap_net.rdf Wed Feb 15 15:21:49 2017 @@ -39,6 +39,13 @@ commons-net +3.6 +2017-02-15 + + + + +commons-net 3.5 2016-05-05
svn commit: r18351 - in /release/commons/net: binaries/ source/
Author: sebb Date: Wed Feb 15 18:45:24 2017 New Revision: 18351 Log: Archive net release 3.5 Removed: release/commons/net/binaries/commons-net-3.5-bin.tar.gz release/commons/net/binaries/commons-net-3.5-bin.tar.gz.asc release/commons/net/binaries/commons-net-3.5-bin.tar.gz.md5 release/commons/net/binaries/commons-net-3.5-bin.tar.gz.sha1 release/commons/net/binaries/commons-net-3.5-bin.zip release/commons/net/binaries/commons-net-3.5-bin.zip.asc release/commons/net/binaries/commons-net-3.5-bin.zip.md5 release/commons/net/binaries/commons-net-3.5-bin.zip.sha1 release/commons/net/source/commons-net-3.5-src.tar.gz release/commons/net/source/commons-net-3.5-src.tar.gz.asc release/commons/net/source/commons-net-3.5-src.tar.gz.md5 release/commons/net/source/commons-net-3.5-src.tar.gz.sha1 release/commons/net/source/commons-net-3.5-src.zip release/commons/net/source/commons-net-3.5-src.zip.asc release/commons/net/source/commons-net-3.5-src.zip.md5 release/commons/net/source/commons-net-3.5-src.zip.sha1
svn commit: r1783138 - /commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java
Author: sebb Date: Wed Feb 15 18:56:16 2017 New Revision: 1783138 URL: http://svn.apache.org/viewvc?rev=1783138&view=rev Log: Javadoc Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java?rev=1783138&r1=1783137&r2=1783138&view=diff == --- commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java (original) +++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/tftp/TFTP.java Wed Feb 15 18:56:16 2017 @@ -308,8 +308,8 @@ public class TFTP extends DatagramSocket * * Override it to trace the data, for example: * {@code System.out.println(direction + " " + packet.toString());} - * @param direction ">" or "<" - * @param packet the packet to be sent or that has been received + * @param direction {@code >} or {@code <} + * @param packet the packet to be sent or that has been received respectively * @since 3.6 */ protected void trace(String direction, TFTPPacket packet) {
commons-crypto git commit: CRYPTO-129 Revert unnecessary exposure of instance variables
Repository: commons-crypto Updated Branches: refs/heads/master 9f73f2fc1 -> c24b691ac CRYPTO-129 Revert unnecessary exposure of instance variables Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/c24b691a Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/c24b691a Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/c24b691a Branch: refs/heads/master Commit: c24b691ac4efadb8fa4c6beac63d58cb4a9faa6e Parents: 9f73f2f Author: Sebb Authored: Wed Feb 15 22:01:16 2017 + Committer: Sebb Committed: Wed Feb 15 22:01:16 2017 + -- .../apache/commons/crypto/stream/CryptoInputStream.java | 10 +- .../apache/commons/crypto/stream/CryptoOutputStream.java | 10 +- .../apache/commons/crypto/cipher/AbstractCipherTest.java | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/c24b691a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java -- diff --git a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java b/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java index 5c2bb14..a7f7622 100644 --- a/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java +++ b/src/main/java/org/apache/commons/crypto/stream/CryptoInputStream.java @@ -58,13 +58,13 @@ public class CryptoInputStream extends InputStream implements + "stream.buffer.size"; /** The CryptoCipher instance. */ -protected final CryptoCipher cipher; +final CryptoCipher cipher; // package protected for access by crypto classes; do not expose futher /** The buffer size. */ private final int bufferSize; /** Crypto key for the cipher. */ -protected final Key key; +final Key key; // package protected for access by crypto classes; do not expose futher /** the algorithm parameters */ private final AlgorithmParameterSpec params; @@ -78,19 +78,19 @@ public class CryptoInputStream extends InputStream implements private boolean finalDone = false; /** The input data. */ -protected Input input; +Input input; // package protected for access by crypto classes; do not expose futher /** * Input data buffer. The data starts at inBuffer.position() and ends at to * inBuffer.limit(). */ -protected ByteBuffer inBuffer; +ByteBuffer inBuffer; // package protected for access by crypto classes; do not expose futher /** * The decrypted data buffer. The data starts at outBuffer.position() and * ends at outBuffer.limit(). */ -protected ByteBuffer outBuffer; +ByteBuffer outBuffer; // package protected for access by crypto classes; do not expose futher // stream related configuration keys /** http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/c24b691a/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java -- diff --git a/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java b/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java index 7e86809..4246713 100644 --- a/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java +++ b/src/main/java/org/apache/commons/crypto/stream/CryptoOutputStream.java @@ -50,16 +50,16 @@ public class CryptoOutputStream extends OutputStream implements private final byte[] oneByteBuf = new byte[1]; /** The output. */ -protected Output output; +Output output; // package protected for access by crypto classes; do not expose futher /** the CryptoCipher instance */ -protected final CryptoCipher cipher; +final CryptoCipher cipher; // package protected for access by crypto classes; do not expose futher /** The buffer size. */ private final int bufferSize; /** Crypto key for the cipher. */ -protected final Key key; +final Key key; // package protected for access by crypto classes; do not expose futher /** the algorithm parameters */ private final AlgorithmParameterSpec params; @@ -71,13 +71,13 @@ public class CryptoOutputStream extends OutputStream implements * Input data buffer. The data starts at inBuffer.position() and ends at * inBuffer.limit(). */ -protected ByteBuffer inBuffer; +ByteBuffer inBuffer; // package protected for access by crypto classes; do not expose futher /** * Encrypted data buffer. The data starts at outBuffer.position() and ends * at outBuffer.limit(). */ -protected ByteBuffer outBuffer; +ByteBuffer outBuffer; // pack
commons-crypto git commit: Tab police
Repository: commons-crypto Updated Branches: refs/heads/master c24b691ac -> 158be0644 Tab police Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/158be064 Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/158be064 Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/158be064 Branch: refs/heads/master Commit: 158be0644c353a617427ab190a4f09082cda42ac Parents: c24b691 Author: Sebb Authored: Wed Feb 15 22:11:02 2017 + Committer: Sebb Committed: Wed Feb 15 22:11:02 2017 + -- .../apache/commons/crypto/OpenSslInfoNative.c | 28 ++-- .../commons/crypto/cipher/OpenSslNative.c | 2 +- .../commons/crypto/org_apache_commons_crypto.h | 26 +- .../crypto/random/OpenSslCryptoRandomNative.c | 2 +- 4 files changed, 29 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/158be064/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c -- diff --git a/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c b/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c index 85d1407..bb71638 100644 --- a/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c +++ b/src/main/native/org/apache/commons/crypto/OpenSslInfoNative.c @@ -73,7 +73,7 @@ static void get_methods(JNIEnv *env, HMODULE openssl) } static int load_library(JNIEnv *env) { - char msg[100]; +char msg[100]; #ifdef UNIX openssl = dlopen(COMMONS_CRYPTO_OPENSSL_LIBRARY, RTLD_LAZY | RTLD_GLOBAL); #endif @@ -89,7 +89,7 @@ static int load_library(JNIEnv *env) #endif #ifdef WINDOWS snprintf(msg, sizeof(msg), "Cannot load %s (%d)!", COMMONS_CRYPTO_OPENSSL_LIBRARY, \ - GetLastError()); +GetLastError()); #endif THROW(env, "java/lang/UnsatisfiedLinkError", msg); return 0; @@ -101,37 +101,37 @@ static int load_library(JNIEnv *env) JNIEXPORT jstring JNICALL Java_org_apache_commons_crypto_OpenSslInfoNative_SSLeayVersion (JNIEnv *env, jclass clazz, jint type) { - if (!load_library(env)) { - return NULL; - } +if (!load_library(env)) { +return NULL; +} - jstring answer = (*env)->NewStringUTF(env,dlsym_SSLeay_version(type)); - return answer; +jstring answer = (*env)->NewStringUTF(env,dlsym_SSLeay_version(type)); +return answer; } JNIEXPORT jlong JNICALL Java_org_apache_commons_crypto_OpenSslInfoNative_SSLeay (JNIEnv *env, jobject object) { - if (!load_library(env)) { - return 0; - } - return dlsym_SSLeay(); +if (!load_library(env)) { +return 0; +} +return dlsym_SSLeay(); } JNIEXPORT jstring JNICALL Java_org_apache_commons_crypto_OpenSslInfoNative_NativeVersion (JNIEnv *env, jobject object) { - return (*env)->NewStringUTF(env, VERSION); +return (*env)->NewStringUTF(env, VERSION); } JNIEXPORT jstring JNICALL Java_org_apache_commons_crypto_OpenSslInfoNative_NativeTimeStamp (JNIEnv *env, jobject object) { - return (*env)->NewStringUTF(env, __DATE__); +return (*env)->NewStringUTF(env, __DATE__); } JNIEXPORT jstring JNICALL Java_org_apache_commons_crypto_OpenSslInfoNative_NativeName (JNIEnv *env, jobject object) { - return (*env)->NewStringUTF(env, PROJECT_NAME); +return (*env)->NewStringUTF(env, PROJECT_NAME); } http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/158be064/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c -- diff --git a/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c b/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c index 5e39e13..46196e5 100644 --- a/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c +++ b/src/main/native/org/apache/commons/crypto/cipher/OpenSslNative.c @@ -135,7 +135,7 @@ JNIEXPORT void JNICALL Java_org_apache_commons_crypto_cipher_OpenSslNative_initI #endif #ifdef WINDOWS snprintf(msg, sizeof(msg), "Cannot load %s (%d)!", COMMONS_CRYPTO_OPENSSL_LIBRARY, \ - GetLastError()); +GetLastError()); #endif THROW(env, "java/lang/UnsatisfiedLinkError", msg); return; http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/158be064/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h -- diff --git a/src/main/native/org/apache/commons/crypto/org_apache_commons_crypto.h b/src/main/native/org/apache/commons/crypto/org_apache_commons_cryp
svn commit: r1783203 - in /commons/proper/validator/trunk/src: changes/changes.xml main/java/org/apache/commons/validator/routines/UrlValidator.java test/java/org/apache/commons/validator/routines/Url
Author: sebb Date: Thu Feb 16 13:38:33 2017 New Revision: 1783203 URL: http://svn.apache.org/viewvc?rev=1783203&view=rev Log: VALIDATOR-420 Query params validator shouldn't accept whitespaces Modified: commons/proper/validator/trunk/src/changes/changes.xml commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1783203&r1=1783202&r2=1783203&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Thu Feb 16 13:38:33 2017 @@ -98,6 +98,9 @@ The dependencies for Validator have not For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html "> + +Query params validator shouldn't accept whitespaces + Invalid IPv6 addresses that are IPv4-mapped pass InetAddressValidator validation Modified: commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java?rev=1783203&r1=1783202&r2=1783203&view=diff == --- commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java (original) +++ commons/proper/validator/trunk/src/main/java/org/apache/commons/validator/routines/UrlValidator.java Thu Feb 16 13:38:33 2017 @@ -168,7 +168,7 @@ public class UrlValidator implements Ser private static final String PATH_REGEX = "^(/[-\\w:@&?=+,.!/~*'%$_;\\(\\)]*)?$"; private static final Pattern PATH_PATTERN = Pattern.compile(PATH_REGEX); -private static final String QUERY_REGEX = "^(.*)$"; +private static final String QUERY_REGEX = "^(\\S*)$"; private static final Pattern QUERY_PATTERN = Pattern.compile(QUERY_REGEX); /** Modified: commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java?rev=1783203&r1=1783202&r2=1783203&view=diff == --- commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java (original) +++ commons/proper/validator/trunk/src/test/java/org/apache/commons/validator/routines/UrlValidatorTest.java Thu Feb 16 13:38:33 2017 @@ -491,6 +491,13 @@ protected void setUp() { assertTrue(validator.isValid("http://www.apache.org:/path";)); } + public void testValidator420() { + UrlValidator validator = new UrlValidator(); + assertFalse(validator.isValid("http://example.com/serach?address=Main Avenue")); + assertTrue(validator.isValid("http://example.com/serach?address=Main%20Avenue";)); + assertTrue(validator.isValid("http://example.com/serach?address=Main+Avenue";)); + } + // Test data for creating a composite URL /** * The data given below approximates the 4 parts of a URL
svn commit: r1783207 - /commons/proper/validator/trunk/RELEASE-NOTES.txt
Author: sebb Date: Thu Feb 16 13:46:14 2017 New Revision: 1783207 URL: http://svn.apache.org/viewvc?rev=1783207&view=rev Log: Latest change Modified: commons/proper/validator/trunk/RELEASE-NOTES.txt Modified: commons/proper/validator/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/RELEASE-NOTES.txt?rev=1783207&r1=1783206&r2=1783207&view=diff == --- commons/proper/validator/trunk/RELEASE-NOTES.txt (original) +++ commons/proper/validator/trunk/RELEASE-NOTES.txt Thu Feb 16 13:46:14 2017 @@ -34,6 +34,7 @@ o VALIDATOR-413: Generic CreditCard val o VALIDATOR-394: General Modulus Ten Check Digit Implementation Thanks to Niall Pemberton. Fixed Bugs: +o VALIDATOR-420: Query params validator shouldn't accept whitespaces Thanks to Marcin Gasior. o VALIDATOR-419: Invalid IPv6 addresses that are IPv4-mapped pass InetAddressValidator validation Thanks to Denis Iskhakov. o VALIDATOR-418: UrlValidatorTest: testIsValid() does not run all tests Thanks to Robert McGuigan. o VALIDATOR-379: CodeValidator unconditionally trim()s the input string - document the behaviour
svn commit: r1783209 - /commons/proper/validator/trunk/src/changes/changes.xml
Author: sebb Date: Thu Feb 16 13:48:55 2017 New Revision: 1783209 URL: http://svn.apache.org/viewvc?rev=1783209&view=rev Log: Guess at the release date Modified: commons/proper/validator/trunk/src/changes/changes.xml Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1783209&r1=1783208&r2=1783209&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Thu Feb 16 13:48:55 2017 @@ -64,7 +64,7 @@ The type attribute can be add,u --> -
svn commit: r1783216 - /commons/proper/validator/trunk/pom.xml
Author: sebb Date: Thu Feb 16 14:06:09 2017 New Revision: 1783216 URL: http://svn.apache.org/viewvc?rev=1783216&view=rev Log: No longer need older version Modified: commons/proper/validator/trunk/pom.xml Modified: commons/proper/validator/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/pom.xml?rev=1783216&r1=1783215&r2=1783216&view=diff == --- commons/proper/validator/trunk/pom.xml (original) +++ commons/proper/validator/trunk/pom.xml Thu Feb 16 14:06:09 2017 @@ -143,8 +143,6 @@ 1.6 RC1 (requires JDK ${maven.compiler.target}) -1.4.1 -(requires JDK 1.4) VALIDATOR 12310494 UTF-8
svn commit: r1783221 - /commons/proper/validator/trunk/src/site/xdoc/download_validator.xml
Author: sebb Date: Thu Feb 16 14:12:19 2017 New Revision: 1783221 URL: http://svn.apache.org/viewvc?rev=1783221&view=rev Log: No longer need older version Modified: commons/proper/validator/trunk/src/site/xdoc/download_validator.xml Modified: commons/proper/validator/trunk/src/site/xdoc/download_validator.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/site/xdoc/download_validator.xml?rev=1783221&r1=1783220&r2=1783221&view=diff == --- commons/proper/validator/trunk/src/site/xdoc/download_validator.xml (original) +++ commons/proper/validator/trunk/src/site/xdoc/download_validator.xml Thu Feb 16 14:12:19 2017 @@ -141,36 +141,6 @@ limitations under the License. - - - - - commons-validator-1.4.1-bin.tar.gz - https://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1-bin.tar.gz.md5";>md5 - https://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1-bin.tar.gz.asc";>pgp - - - commons-validator-1.4.1-bin.zip - https://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1-bin.zip.md5";>md5 - https://www.apache.org/dist/commons/validator/binaries/commons-validator-1.4.1-bin.zip.asc";>pgp - - - - - - - commons-validator-1.4.1-src.tar.gz - https://www.apache.org/dist/commons/validator/source/commons-validator-1.4.1-src.tar.gz.md5";>md5 - https://www.apache.org/dist/commons/validator/source/commons-validator-1.4.1-src.tar.gz.asc";>pgp - - - commons-validator-1.4.1-src.zip - https://www.apache.org/dist/commons/validator/source/commons-validator-1.4.1-src.zip.md5";>md5 - https://www.apache.org/dist/commons/validator/source/commons-validator-1.4.1-src.zip.asc";>pgp - - - - Older releases can be obtained from the archives.
svn commit: r1783223 - /commons/proper/validator/trunk/etc/
Author: sebb Date: Thu Feb 16 14:18:25 2017 New Revision: 1783223 URL: http://svn.apache.org/viewvc?rev=1783223&view=rev Log: VALIDATOR-371 Drop the Javascript code entirely Drop the Javascript Javadoc utils as well Removed: commons/proper/validator/trunk/etc/
svn commit: r1783224 - /commons/proper/validator/trunk/build.xml
Author: sebb Date: Thu Feb 16 14:19:30 2017 New Revision: 1783224 URL: http://svn.apache.org/viewvc?rev=1783224&view=rev Log: Drop obsolete Ant build Removed: commons/proper/validator/trunk/build.xml
svn commit: r1783225 - /commons/proper/validator/trunk/build.properties.sample
Author: sebb Date: Thu Feb 16 14:20:21 2017 New Revision: 1783225 URL: http://svn.apache.org/viewvc?rev=1783225&view=rev Log: Drop obsolete Ant build Removed: commons/proper/validator/trunk/build.properties.sample
svn commit: r1783233 - in /commons/proper/validator/tags/VALIDATOR_1_6_RC1: ./ pom.xml
Author: sebb Date: Thu Feb 16 14:57:16 2017 New Revision: 1783233 URL: http://svn.apache.org/viewvc?rev=1783233&view=rev Log: Creating VALIDATOR_1_6_RC1 tag Added: commons/proper/validator/tags/VALIDATOR_1_6_RC1/ - copied from r1783232, commons/proper/validator/trunk/ Modified: commons/proper/validator/tags/VALIDATOR_1_6_RC1/pom.xml Modified: commons/proper/validator/tags/VALIDATOR_1_6_RC1/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/tags/VALIDATOR_1_6_RC1/pom.xml?rev=1783233&r1=1783232&r2=1783233&view=diff == --- commons/proper/validator/tags/VALIDATOR_1_6_RC1/pom.xml (original) +++ commons/proper/validator/tags/VALIDATOR_1_6_RC1/pom.xml Thu Feb 16 14:57:16 2017 @@ -25,7 +25,7 @@ 4.0.0 commons-validator commons-validator - 1.6-SNAPSHOT + 1.6 Apache Commons Validator Apache Commons Validator provides the building blocks for both client side validation and server side data validation. @@ -124,9 +124,9 @@ - scm:svn:http://svn.apache.org/repos/asf/commons/proper/validator/trunk/ - scm:svn:https://svn.apache.org/repos/asf/commons/proper/validator/trunk/ -http://svn.apache.org/viewvc/commons/proper/validator/trunk/ + scm:svn:http://svn.apache.org/repos/asf/commons/proper/validator/tags/VALIDATOR_1_6/ + scm:svn:https://svn.apache.org/repos/asf/commons/proper/validator/tags/VALIDATOR_1_6/ + http://svn.apache.org/viewvc/commons/proper/validator/tags/VALIDATOR_1_6/
svn commit: r18365 - /dev/commons/validator/1.6_RC1/
Author: sebb Date: Thu Feb 16 15:36:20 2017 New Revision: 18365 Log: Creating tag 1.6_RC1 Added: dev/commons/validator/1.6_RC1/ dev/commons/validator/1.6_RC1/RELEASE-NOTES.txt (with props) dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz (with props) dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.asc dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.md5 dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.sha1 dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip (with props) dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.asc dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.md5 dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.sha1 dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz (with props) dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.asc dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.md5 dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.sha1 dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip (with props) dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.asc dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.md5 dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.sha1 Added: dev/commons/validator/1.6_RC1/RELEASE-NOTES.txt == --- dev/commons/validator/1.6_RC1/RELEASE-NOTES.txt (added) +++ dev/commons/validator/1.6_RC1/RELEASE-NOTES.txt Thu Feb 16 15:36:20 2017 @@ -0,0 +1,59 @@ + Apache Commons Validator 1.6 + RELEASE NOTES + +The Apache Commons Validator team is pleased to announce the release of Apache Commons Validator 1.6 + +Apache Commons Validator provides the building blocks for both client side validation and server side data validation. +It may be used standalone or with a framework like Struts. + +This is primarily a maintenance release. +All projects are encouraged to update to this release of Apache Commons Validator. + +Commons Validator requires Java 1.6 or later. +Main enhancements = +* Modulus Ten Check Digit Implementation +* Generic CreditCard validation (syntax and checkdigit only; does not check IIN) +* CreditCard validation specification by numeric range + IMPORTANT NOTES +=== + +BREAKING CHANGES: + + * NONE. + +DEPENDENCIES + +The dependencies for Validator have not changed since the 1.4 release. +For the current list of dependencies, please see http://commons.apache.org/validator/dependencies.html + +Changes in this version include: + +New features: +o VALIDATOR-415: Simplify building new CreditCard validators +o VALIDATOR-413: Generic CreditCard validation +o VALIDATOR-394: General Modulus Ten Check Digit Implementation Thanks to Niall Pemberton. + +Fixed Bugs: +o VALIDATOR-420: Query params validator shouldn't accept whitespaces Thanks to Marcin Gasior. +o VALIDATOR-419: Invalid IPv6 addresses that are IPv4-mapped pass InetAddressValidator validation Thanks to Denis Iskhakov. +o VALIDATOR-418: UrlValidatorTest: testIsValid() does not run all tests Thanks to Robert McGuigan. +o VALIDATOR-379: CodeValidator unconditionally trim()s the input string - document the behaviour +o VALIDATOR-387: Userinfo without colon should be valid in UrlValidator Thanks to Shumpei Akai. +o VALIDATOR-411: UrlValidator accepts ports above max limit of 16-bit unsigned integer +o VALIDATOR-407: Generic .shop top level domain is considered invalid +o VALIDATOR-405: IBANValidator - Costa Rica entry has been updated in SWIFT docs +o VALIDATOR-401: IBANValidator fails for Seychelles and Ukraine +o VALIDATOR-391: UrlValidator.isValid throws exception for FILEURLs + Fixed code so it handles URLs with no authority field Thanks to Mark E. Scott, Jr. & Jason Loomis. + +Changes: +o IANA TLD lists: Updated to Version 2017020400, Last Updated Sat Feb 4 07:07:01 2017 UTC +o Update to version 73 of SWIFT IBAN list: added BY (Belarus) and IQ (Iraq); fixed Santa Lucia format + + +Historical list of changes: http://commons.apache.org/proper/commons-validator/changes-report.html + +For complete information on Apache Commons Validator, including instructions on how to submit bug reports, +patches, or suggestions for improvement, see the Apache Apache Commons Validator website: + +http://commons.apache.org/proper/commons-validator/ Propchange: dev/commons/validator/1.6_RC1/RELEASE-NOTES.txt -- svn:eol-style = native Added: dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz == Binary file - no diff available. Propchange: dev/commons/validator/1.6_RC
[lang] Use StringBuilders instead of StringBuffers
Repository: commons-lang Updated Branches: refs/heads/master ce1bd5785 -> 30c85ad05 Use StringBuilders instead of StringBuffers (A couple of instances were overlooked) This fixes #236 Project: http://git-wip-us.apache.org/repos/asf/commons-lang/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-lang/commit/30c85ad0 Tree: http://git-wip-us.apache.org/repos/asf/commons-lang/tree/30c85ad0 Diff: http://git-wip-us.apache.org/repos/asf/commons-lang/diff/30c85ad0 Branch: refs/heads/master Commit: 30c85ad05363767deeefee577063c2c432b971d4 Parents: ce1bd57 Author: Sebb Authored: Thu Feb 16 18:59:01 2017 + Committer: Sebb Committed: Thu Feb 16 18:59:01 2017 + -- src/main/java/org/apache/commons/lang3/RandomStringUtils.java | 6 +++--- src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java| 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/commons-lang/blob/30c85ad0/src/main/java/org/apache/commons/lang3/RandomStringUtils.java -- diff --git a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java index 549bea2..ec62d50 100644 --- a/src/main/java/org/apache/commons/lang3/RandomStringUtils.java +++ b/src/main/java/org/apache/commons/lang3/RandomStringUtils.java @@ -380,7 +380,7 @@ public class RandomStringUtils { } } -StringBuffer buffer = new StringBuffer(count); +StringBuilder builder = new StringBuilder(count); final int gap = end - start; while (count-- != 0) { @@ -409,7 +409,7 @@ public class RandomStringUtils { if (letters && Character.isLetter(codePoint) || numbers && Character.isDigit(codePoint) || !letters && !numbers) { -buffer.appendCodePoint(codePoint); +builder.appendCodePoint(codePoint); if (numberOfChars == 2) { count--; @@ -419,7 +419,7 @@ public class RandomStringUtils { count++; } } -return buffer.toString(); +return builder.toString(); } http://git-wip-us.apache.org/repos/asf/commons-lang/blob/30c85ad0/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java -- diff --git a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java index 657a85e..63da4e4 100644 --- a/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/ArrayUtilsTest.java @@ -280,8 +280,8 @@ public class ArrayUtilsTest { assertTrue(Arrays.equals(original1, cloned1)); assertTrue(original1 != cloned1); -final StringBuffer buf = new StringBuffer("pick"); -original1 = new Object[] {buf, "a", new String[] {"stick"}}; +final StringBuilder builder = new StringBuilder("pick"); +original1 = new Object[] {builder, "a", new String[] {"stick"}}; cloned1 = ArrayUtils.clone(original1); assertTrue(Arrays.equals(original1, cloned1)); assertTrue(original1 != cloned1);
svn commit: r1783366 - /commons/proper/validator/trunk/src/changes/changes.xml
Author: sebb Date: Fri Feb 17 10:51:40 2017 New Revision: 1783366 URL: http://svn.apache.org/viewvc?rev=1783366&view=rev Log: Fix line breaks Modified: commons/proper/validator/trunk/src/changes/changes.xml Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1783366&r1=1783365&r2=1783366&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Fri Feb 17 10:51:40 2017 @@ -72,14 +72,15 @@ Apache Commons Validator. Commons Validator requires Java 1.6 or later. -Main enhancements -= -* Modulus Ten Check Digit Implementation + Main enhancements + = -* Generic CreditCard validation (syntax and checkdigit only; does not check IIN) -* CreditCard validation specification by numeric range + * Modulus Ten Check Digit Implementation + * Generic CreditCard validation (syntax and checkdigit only; does not check IIN) + * CreditCard validation specification by numeric range + IMPORTANT NOTES ===
svn commit: r18400 - /dev/commons/validator/1.6_RC1/ /release/commons/validator/ /release/commons/validator/binaries/ /release/commons/validator/source/
Author: sebb Date: Mon Feb 20 10:03:50 2017 New Revision: 18400 Log: Release 1.6 from RC1 Added: release/commons/validator/RELEASE-NOTES.txt - copied unchanged from r18399, dev/commons/validator/1.6_RC1/RELEASE-NOTES.txt release/commons/validator/binaries/commons-validator-1.6-bin.tar.gz - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz release/commons/validator/binaries/commons-validator-1.6-bin.tar.gz.asc - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.asc release/commons/validator/binaries/commons-validator-1.6-bin.tar.gz.md5 - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.md5 release/commons/validator/binaries/commons-validator-1.6-bin.tar.gz.sha1 - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.sha1 release/commons/validator/binaries/commons-validator-1.6-bin.zip - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip release/commons/validator/binaries/commons-validator-1.6-bin.zip.asc - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.asc release/commons/validator/binaries/commons-validator-1.6-bin.zip.md5 - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.md5 release/commons/validator/binaries/commons-validator-1.6-bin.zip.sha1 - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.sha1 release/commons/validator/source/commons-validator-1.6-src.tar.gz - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz release/commons/validator/source/commons-validator-1.6-src.tar.gz.asc - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.asc release/commons/validator/source/commons-validator-1.6-src.tar.gz.md5 - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.md5 release/commons/validator/source/commons-validator-1.6-src.tar.gz.sha1 - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.sha1 release/commons/validator/source/commons-validator-1.6-src.zip - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip release/commons/validator/source/commons-validator-1.6-src.zip.asc - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.asc release/commons/validator/source/commons-validator-1.6-src.zip.md5 - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.md5 release/commons/validator/source/commons-validator-1.6-src.zip.sha1 - copied unchanged from r18399, dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.sha1 Removed: dev/commons/validator/1.6_RC1/RELEASE-NOTES.txt dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.asc dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.md5 dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.tar.gz.sha1 dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.asc dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.md5 dev/commons/validator/1.6_RC1/commons-validator-1.6-bin.zip.sha1 dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.asc dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.md5 dev/commons/validator/1.6_RC1/commons-validator-1.6-src.tar.gz.sha1 dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.asc dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.md5 dev/commons/validator/1.6_RC1/commons-validator-1.6-src.zip.sha1
svn commit: r1783734 - /commons/proper/validator/tags/VALIDATOR_1_6/
Author: sebb Date: Mon Feb 20 10:09:44 2017 New Revision: 1783734 URL: http://svn.apache.org/viewvc?rev=1783734&view=rev Log: Validator 1.6 based on RC1 Added: commons/proper/validator/tags/VALIDATOR_1_6/ - copied from r1783733, commons/proper/validator/tags/VALIDATOR_1_6_RC1/
svn commit: r1783867 - in /commons/cms-site/trunk: conf/component_releases.properties doap/doap_validator.rdf
Author: sebb Date: Tue Feb 21 11:40:59 2017 New Revision: 1783867 URL: http://svn.apache.org/viewvc?rev=1783867&view=rev Log: Validator 1.6 released Modified: commons/cms-site/trunk/conf/component_releases.properties commons/cms-site/trunk/doap/doap_validator.rdf Modified: commons/cms-site/trunk/conf/component_releases.properties URL: http://svn.apache.org/viewvc/commons/cms-site/trunk/conf/component_releases.properties?rev=1783867&r1=1783866&r2=1783867&view=diff == --- commons/cms-site/trunk/conf/component_releases.properties (original) +++ commons/cms-site/trunk/conf/component_releases.properties Tue Feb 21 11:40:59 2017 @@ -78,8 +78,8 @@ scxmlVersion=0.9 scxmlReleased=2008-12-01 textVersion=1.0-beta-1 textReleased=2017-02-09 -validatorVersion=1.5.1 -validatorReleased=2016-04-30 +validatorVersion=1.6 +validatorReleased=2017-02-21 vfsVersion=2.1 vfsReleased=2016-05-12 weaverVersion=1.3 Modified: commons/cms-site/trunk/doap/doap_validator.rdf URL: http://svn.apache.org/viewvc/commons/cms-site/trunk/doap/doap_validator.rdf?rev=1783867&r1=1783866&r2=1783867&view=diff == --- commons/cms-site/trunk/doap/doap_validator.rdf (original) +++ commons/cms-site/trunk/doap/doap_validator.rdf Tue Feb 21 11:40:59 2017 @@ -42,6 +42,13 @@ Latest Stable Release +2017-02-21 +1.6 + + + + +Latest Stable Release 2016-04-30 1.5.1
svn commit: r1783869 - in /commons/proper/validator/trunk: pom.xml src/changes/changes.xml
Author: sebb Date: Tue Feb 21 11:44:05 2017 New Revision: 1783869 URL: http://svn.apache.org/viewvc?rev=1783869&view=rev Log: 1.6 Released Modified: commons/proper/validator/trunk/pom.xml commons/proper/validator/trunk/src/changes/changes.xml Modified: commons/proper/validator/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/pom.xml?rev=1783869&r1=1783868&r2=1783869&view=diff == --- commons/proper/validator/trunk/pom.xml (original) +++ commons/proper/validator/trunk/pom.xml Tue Feb 21 11:44:05 2017 @@ -25,7 +25,7 @@ 4.0.0 commons-validator commons-validator - 1.6-SNAPSHOT + 1.7-SNAPSHOT Apache Commons Validator Apache Commons Validator provides the building blocks for both client side validation and server side data validation. Modified: commons/proper/validator/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/validator/trunk/src/changes/changes.xml?rev=1783869&r1=1783868&r2=1783869&view=diff == --- commons/proper/validator/trunk/src/changes/changes.xml (original) +++ commons/proper/validator/trunk/src/changes/changes.xml Tue Feb 21 11:44:05 2017 @@ -64,7 +64,7 @@ The type attribute can be add,u --> -