You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2011/03/14 18:10:00 UTC
svn commit: r1081476 -
/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/
Author: sebb
Date: Mon Mar 14 17:09:59 2011
New Revision: 1081476
URL: http://svn.apache.org/viewvc?rev=1081476&view=rev
Log:
Trailing spaces
Modified:
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java
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/FTPFileEntryParserFactory.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParser.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/UnixFTPEntryParser.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSVersioningFTPEntryParser.java
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/ConfigurableFTPFileEntryParserImpl.java Mon Mar 14 17:09:59 2011
@@ -42,16 +42,16 @@ import org.apache.commons.net.ftp.FTPCli
* To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates - Comments
*/
-public abstract class ConfigurableFTPFileEntryParserImpl
-extends RegexFTPFileEntryParserImpl
-implements Configurable
+public abstract class ConfigurableFTPFileEntryParserImpl
+extends RegexFTPFileEntryParserImpl
+implements Configurable
{
private final FTPTimestampParser timestampParser;
-
+
/**
* Only constructor for this abstract class.
- * @param regex Regular expression used main parsing of the
+ * @param regex Regular expression used main parsing of the
* file listing.
*/
public ConfigurableFTPFileEntryParserImpl(String regex)
@@ -64,11 +64,11 @@ implements Configurable
* This method is called by the concrete parsers to delegate
* timestamp parsing to the timestamp parser.
* <p>
- * @param timestampStr the timestamp string pulled from the
+ * @param timestampStr the timestamp string pulled from the
* file listing by the regular expression parser, to be submitted
* to the <code>timestampParser</code> for extracting the timestamp.
- * @return a <code>java.util.Calendar</code> containing results of the
- * timestamp parse.
+ * @return a <code>java.util.Calendar</code> containing results of the
+ * timestamp parse.
*/
public Calendar parseTimestamp(String timestampStr) throws ParseException {
return this.timestampParser.parseTimestamp(timestampStr);
@@ -82,7 +82,7 @@ implements Configurable
* passing it the supplied {@link FTPClientConfig FTPClientConfig}
* if that is non-null or a default configuration defined by
* each concrete subclass.
- * </p>
+ * </p>
* @param config the configuration to be used to configure this parser.
* If it is null, a default configuration defined by
* each concrete subclass is used instead.
@@ -104,7 +104,7 @@ implements Configurable
}
}
}
-
+
/**
* Each concrete subclass must define this member to create
* a default configuration to be used when that subclass is
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=1081476&r1=1081475&r2=1081476&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 Mar 14 17:09:59 2011
@@ -96,7 +96,7 @@ public class DefaultFTPFileEntryParserFa
// Common method to process both key and config parameters.
private FTPFileEntryParser createFileEntryParser(String key, FTPClientConfig config) {
FTPFileEntryParser parser = null;
-
+
// Is the key a possible class name?
if (JAVA_QUALIFIED_NAME_PATTERN.matcher(key).matches()) {
try
@@ -111,16 +111,16 @@ public class DefaultFTPFileEntryParserFa
} catch (Exception e) {
throw new ParserInitializationException("Error initializing parser", e);
} catch (ExceptionInInitializerError e) {
- throw new ParserInitializationException("Error initializing parser", e);
+ throw new ParserInitializationException("Error initializing parser", e);
}
} catch (ClassNotFoundException e) {
// OK, assume it is an alias
- }
+ }
}
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) >= 0)
{
parser = new UnixFTPEntryParser(config);
}
@@ -216,7 +216,7 @@ public class DefaultFTPFileEntryParserFa
}
/**
- * Creates an NT FTP parser: if the config exists, and the system key equals
+ * Creates an NT FTP parser: if the config exists, and the system key equals
* {@link FTPClientConfig.SYST_NT} then a plain {@link NTFTPEntryParser} is used,
* otherwise a composite of {@link NTFTPEntryParser} and {@link UnixFTPEntryParser} is used.
* @param config the config to use, may be {@code null}
@@ -248,7 +248,7 @@ public class DefaultFTPFileEntryParserFa
}
/**
- * Creates an OS400 FTP parser: if the config exists, and the system key equals
+ * Creates an OS400 FTP parser: if the config exists, and the system key equals
* {@link FTPClientConfig.SYST_OS400} then a plain {@link OS400FTPEntryParser} is used,
* otherwise a composite of {@link OS400FTPEntryParser} and {@link UnixFTPEntryParser} is used.
* @param config the config to use, may be {@code null}
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPFileEntryParserFactory.java Mon Mar 14 17:09:59 2011
@@ -39,7 +39,7 @@ public interface FTPFileEntryParserFacto
*/
public FTPFileEntryParser createFileEntryParser(String key)
throws ParserInitializationException;
-
+
/**
*<p>
* Implementation should be a method that extracts
@@ -54,7 +54,7 @@ public interface FTPFileEntryParserFacto
* and knows what that configuration is.
* </p>
*
- * @param config A {@link FTPClientConfig FTPClientConfig}
+ * @param config A {@link FTPClientConfig FTPClientConfig}
* used to configure the parser created
*
* @return the @link FTPFileEntryParser FTPFileEntryParser} so created.
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParser.java Mon Mar 14 17:09:59 2011
@@ -21,32 +21,32 @@ import java.text.ParseException;
import java.util.Calendar;
/**
- * This interface specifies the concept of parsing an FTP server's
+ * This interface specifies the concept of parsing an FTP server's
* timestamp.
* @since 1.4
*/
public interface FTPTimestampParser {
-
+
/**
- * the default default date format.
+ * the default default date format.
*/
public static final String DEFAULT_SDF = UnixFTPEntryParser.DEFAULT_DATE_FORMAT;
/**
- * the default recent date format.
+ * the default recent date format.
*/
public static final String DEFAULT_RECENT_SDF = UnixFTPEntryParser.DEFAULT_RECENT_DATE_FORMAT;
-
+
/**
- * Parses the supplied datestamp parameter. This parameter typically would
- * have been pulled from a longer FTP listing via the regular expression
+ * Parses the supplied datestamp parameter. This parameter typically would
+ * have been pulled from a longer FTP listing via the regular expression
* mechanism
* @param timestampStr - the timestamp portion of the FTP directory listing
* to be parsed
* @return a <code>java.util.Calendar</code> object initialized to the date
* parsed by the parser
- * @throws ParseException if none of the parser mechanisms belonging to
+ * @throws ParseException if none of the parser mechanisms belonging to
* the implementor can parse the input.
*/
public Calendar parseTimestamp(String timestampStr) throws ParseException;
-
+
}
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/FTPTimestampParserImpl.java Mon Mar 14 17:09:59 2011
@@ -29,7 +29,7 @@ import org.apache.commons.net.ftp.Config
import org.apache.commons.net.ftp.FTPClientConfig;
/**
- * Default implementation of the {@link FTPTimestampParser FTPTimestampParser}
+ * Default implementation of the {@link FTPTimestampParser FTPTimestampParser}
* interface also implements the {@link org.apache.commons.net.ftp.Configurable Configurable}
* interface to allow the parsing to be configured from the outside.
*
@@ -37,55 +37,55 @@ import org.apache.commons.net.ftp.FTPCli
* @since 1.4
*/
public class FTPTimestampParserImpl implements
- FTPTimestampParser, Configurable
+ FTPTimestampParser, Configurable
{
-
+
private SimpleDateFormat defaultDateFormat;
private SimpleDateFormat recentDateFormat;
private boolean lenientFutureDates = false;
-
-
+
+
/**
- * The only constructor for this class.
+ * The only constructor for this class.
*/
public FTPTimestampParserImpl() {
setDefaultDateFormat(DEFAULT_SDF);
setRecentDateFormat(DEFAULT_RECENT_SDF);
}
-
- /**
+
+ /**
* Implements the one {@link FTPTimestampParser#parseTimestamp(String) method}
- * in the {@link FTPTimestampParser FTPTimestampParser} interface
+ * in the {@link FTPTimestampParser FTPTimestampParser} interface
* according to this algorithm:
- *
- * If the recentDateFormat member has been defined, try to parse the
+ *
+ * If the recentDateFormat member has been defined, try to parse the
* supplied string with that. If that parse fails, or if the recentDateFormat
* member has not been defined, attempt to parse with the defaultDateFormat
* member. If that fails, throw a ParseException.
- *
+ *
* This method allows a {@link Calendar} instance to be passed in which represents the
* current (system) time.
- *
+ *
* @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String)
- *
+ *
* @param timestampStr The timestamp to be parsed
*/
public Calendar parseTimestamp(String timestampStr) throws ParseException {
Calendar now = Calendar.getInstance();
return parseTimestamp(timestampStr, now);
}
-
- /**
+
+ /**
* Implements the one {@link FTPTimestampParser#parseTimestamp(String) method}
- * in the {@link FTPTimestampParser FTPTimestampParser} interface
+ * in the {@link FTPTimestampParser FTPTimestampParser} interface
* according to this algorithm:
- *
- * If the recentDateFormat member has been defined, try to parse the
+ *
+ * If the recentDateFormat member has been defined, try to parse the
* supplied string with that. If that parse fails, or if the recentDateFormat
* member has not been defined, attempt to parse with the defaultDateFormat
- * member. If that fails, throw a ParseException.
- *
+ * member. If that fails, throw a ParseException.
+ *
* @see org.apache.commons.net.ftp.parser.FTPTimestampParser#parseTimestamp(java.lang.String)
* @param timestampStr The timestamp to be parsed
* @param serverTime The current time for the server
@@ -101,13 +101,13 @@ public class FTPTimestampParserImpl impl
Date parsed = null;
if (recentDateFormat != null) {
if (lenientFutureDates) {
- // add a day to "now" so that "slop" doesn't cause a date
+ // add a day to "now" so that "slop" doesn't cause a date
// slightly in the future to roll back a full year. (Bug 35181)
now.add(Calendar.DATE, 1);
- }
+ }
parsed = recentDateFormat.parse(timestampStr, pp);
}
- if (parsed != null && pp.getIndex() == timestampStr.length())
+ if (parsed != null && pp.getIndex() == timestampStr.length())
{
working.setTime(parsed);
working.set(Calendar.YEAR, now.get(Calendar.YEAR));
@@ -118,14 +118,14 @@ public class FTPTimestampParserImpl impl
} else {
// Temporarily add the current year to the short date time
// to cope with short-date leap year strings.
- // e.g. Java's DateFormatter will assume that "Feb 29 12:00" refers to
+ // e.g. Java's DateFormatter will assume that "Feb 29 12:00" refers to
// Feb 29 1970 (an invalid date) rather than a potentially valid leap year date.
// This is pretty bad hack to work around the deficiencies of the JDK date/time classes.
if (recentDateFormat != null) {
pp = new ParsePosition(0);
int year = now.get(Calendar.YEAR);
String timeStampStrPlusYear = timestampStr + " " + year;
- SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + " yyyy",
+ SimpleDateFormat hackFormatter = new SimpleDateFormat(recentDateFormat.toPattern() + " yyyy",
recentDateFormat.getDateFormatSymbols());
hackFormatter.setLenient(false);
hackFormatter.setTimeZone(recentDateFormat.getTimeZone());
@@ -139,16 +139,16 @@ public class FTPTimestampParserImpl impl
parsed = defaultDateFormat.parse(timestampStr, pp);
// note, length checks are mandatory for us since
// SimpleDateFormat methods will succeed if less than
- // full string is matched. They will also accept,
+ // full string is matched. They will also accept,
// despite "leniency" setting, a two-digit number as
- // a valid year (e.g. 22:04 will parse as 22 A.D.)
- // so could mistakenly confuse an hour with a year,
+ // a valid year (e.g. 22:04 will parse as 22 A.D.)
+ // so could mistakenly confuse an hour with a year,
// if we don't insist on full length parsing.
if (parsed != null && pp.getIndex() == timestampStr.length()) {
working.setTime(parsed);
} else {
throw new ParseException(
- "Timestamp could not be parsed with older or recent DateFormat",
+ "Timestamp could not be parsed with older or recent DateFormat",
pp.getIndex());
}
}
@@ -176,7 +176,7 @@ public class FTPTimestampParserImpl impl
this.defaultDateFormat = new SimpleDateFormat(format);
this.defaultDateFormat.setLenient(false);
}
- }
+ }
/**
* @return Returns the recentDateFormat.
*/
@@ -198,7 +198,7 @@ public class FTPTimestampParserImpl impl
this.recentDateFormat.setLenient(false);
}
}
-
+
/**
* @return returns an array of 12 strings representing the short
* month names used by this parse.
@@ -206,8 +206,8 @@ public class FTPTimestampParserImpl impl
public String[] getShortMonths() {
return defaultDateFormat.getDateFormatSymbols().getShortMonths();
}
-
-
+
+
/**
* @return Returns the serverTimeZone used by this parser.
*/
@@ -230,7 +230,7 @@ public class FTPTimestampParserImpl impl
this.recentDateFormat.setTimeZone(serverTimeZone);
}
}
-
+
/**
* Implementation of the {@link Configurable Configurable}
* interface. Configures this <code>FTPTimestampParser</code> according
@@ -241,21 +241,21 @@ public class FTPTimestampParserImpl impl
* to values supplied in the config based on month names configured as follows:
* </p><p><ul>
* <li>If a {@link FTPClientConfig#setShortMonthNames(String) shortMonthString}
- * has been supplied in the <code>config</code>, use that to parse parse timestamps.</li>
+ * has been supplied in the <code>config</code>, use that to parse parse timestamps.</li>
* <li>Otherwise, if a {@link FTPClientConfig#setServerLanguageCode(String) serverLanguageCode}
- * has been supplied in the <code>config</code>, use the month names represented
+ * has been supplied in the <code>config</code>, use the month names represented
* by that {@link FTPClientConfig#lookupDateFormatSymbols(String) language}
* to parse timestamps.</li>
* <li>otherwise use default English month names</li>
* </ul></p><p>
* Finally if a {@link org.apache.commons.net.ftp.FTPClientConfig#setServerTimeZoneId(String) serverTimeZoneId}
- * has been supplied via the config, set that into all date formats that have
- * been configured.
- * </p>
+ * has been supplied via the config, set that into all date formats that have
+ * been configured.
+ * </p>
*/
public void configure(FTPClientConfig config) {
DateFormatSymbols dfs = null;
-
+
String languageCode = config.getServerLanguageCode();
String shortmonths = config.getShortMonthNames();
if (shortmonths != null) {
@@ -265,8 +265,8 @@ public class FTPTimestampParserImpl impl
} else {
dfs = FTPClientConfig.lookupDateFormatSymbols("en");
}
-
-
+
+
String recentFormatString = config.getRecentDateFormatStr();
if (recentFormatString == null) {
this.recentDateFormat = null;
@@ -274,16 +274,16 @@ public class FTPTimestampParserImpl impl
this.recentDateFormat = new SimpleDateFormat(recentFormatString, dfs);
this.recentDateFormat.setLenient(false);
}
-
+
String defaultFormatString = config.getDefaultDateFormatStr();
if (defaultFormatString == null) {
throw new IllegalArgumentException("defaultFormatString cannot be null");
}
this.defaultDateFormat = new SimpleDateFormat(defaultFormatString, dfs);
this.defaultDateFormat.setLenient(false);
-
+
setServerTimeZone(config.getServerTimeZoneId());
-
+
this.lenientFutureDates = config.isLenientFutureDates();
}
/**
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/MVSFTPEntryParser.java Mon Mar 14 17:09:59 2011
@@ -26,11 +26,11 @@ import org.apache.commons.net.ftp.FTPFil
/**
* Implementation of FTPFileEntryParser and FTPFileListParser for IBM zOS/MVS
* Systems.
- *
+ *
* @author <a href="henrik.sorensen@balcab.ch">Henrik Sorensen</a>
* @author <a href="jnadler@srcginc.com">Jeff Nadler</a>
* @author <a href="wnoto@openfinance.com">William Noto</a>
- *
+ *
* @version $Id$
* @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for
* usage instructions)
@@ -61,7 +61,7 @@ public class MVSFTPEntryParser extends C
/**
* Matches these entries: Volume Unit Referred Ext Used Recfm Lrecl BlkSz
* Dsorg Dsname B10142 3390 2006/03/20 2 31 F 80 80 PS MDI.OKL.WORK
- *
+ *
*/
static final String FILE_LIST_REGEX = "\\S+\\s+" + // volume
// ignored
@@ -127,91 +127,91 @@ public class MVSFTPEntryParser extends C
* Very brief and incomplete description of the zOS/MVS-filesystem. (Note:
* "zOS" is the operating system on the mainframe, and is the new name for
* MVS)
- *
+ *
* The filesystem on the mainframe does not have hierarchal structure as for
* example the unix filesystem. For a more comprehensive description, please
* refer to the IBM manuals
- *
+ *
* @LINK:
* http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/dgt2d440/CONTENTS
- *
- *
+ *
+ *
* Dataset names =============
- *
+ *
* A dataset name consist of a number of qualifiers separated by '.', each
* qualifier can be at most 8 characters, and the total length of a dataset
* can be max 44 characters including the dots.
- *
- *
+ *
+ *
* Dataset organisation ====================
- *
+ *
* A dataset represents a piece of storage allocated on one or more disks.
* The structure of the storage is described with the field dataset
* organinsation (DSORG). There are a number of dataset organisations, but
* only two are usable for FTP transfer.
- *
+ *
* DSORG: PS: sequential, or flat file PO: partitioned dataset PO-E:
* extended partitioned dataset
- *
+ *
* The PS file is just a flat file, as you would find it on the unix file
* system.
- *
+ *
* The PO and PO-E files, can be compared to a single level directory
* structure. A PO file consist of a number of dataset members, or files if
* you will. It is possible to CD into the file, and to retrieve the
* individual members.
- *
- *
+ *
+ *
* Dataset record format =====================
- *
+ *
* The physical layout of the dataset is described on the dataset itself.
* There are a number of record formats (RECFM), but just a few is relavant
* for the FTP transfer.
- *
+ *
* Any one beginning with either F or V can safely used by FTP transfer. All
* others should only be used with great care, so this version will just
* ignore the other record formats. F means a fixed number of records per
* allocated storage, and V means a variable number of records.
- *
- *
+ *
+ *
* Other notes ===========
- *
+ *
* The file system supports automatically backup and retrieval of datasets.
* If a file is backed up, the ftp LIST command will return: ARCIVE Not
* Direct Access Device KJ.IOP998.ERROR.PL.UNITTEST
- *
- *
+ *
+ *
* Implementation notes ====================
- *
+ *
* Only datasets that have dsorg PS, PO or PO-E and have recfm beginning
* with F or V, is fully parsed.
- *
+ *
* The following fields in FTPFile is used: FTPFile.Rawlisting: Always set.
* FTPFile.Type: DIRECTORY_TYPE or FILE_TYPE or UNKNOWN FTPFile.Name: name
* FTPFile.Timestamp: change time or null
- *
- *
- *
+ *
+ *
+ *
* Additional information ======================
- *
+ *
* The MVS ftp server supports a number of features via the FTP interface.
* The features are controlled with the FTP command quote site filetype=<SEQ|JES|DB2>
* SEQ is the default and used for normal file transfer JES is used to
* interact with the Job Entry Subsystem (JES) similar to a job scheduler
* DB2 is used to interact with a DB2 subsystem
- *
+ *
* This parser supports SEQ and JES.
- *
- *
- *
- *
- *
- *
+ *
+ *
+ *
+ *
+ *
+ *
*/
/**
* The sole constructor for a MVSFTPEntryParser object.
- *
+ *
*/
public MVSFTPEntryParser() {
super(""); // note the regex is set in preParse.
@@ -224,7 +224,7 @@ public class MVSFTPEntryParser extends C
* If the file listing line doesn't describe a file, then
* <code> null </code> is returned. Otherwise a <code> FTPFile </code>
* instance representing the file is returned.
- *
+ *
* @param entry
* A line of text from the file listing
* @return An FTPFile instance corresponding to the supplied entry
@@ -249,30 +249,30 @@ public class MVSFTPEntryParser extends C
if (!isParsed)
f = null;
-
+
return f;
}
/**
* Parse entries representing a dataset list. Only datasets with DSORG PS or
* PO or PO-E and with RECFM F* or V* will be parsed.
- *
+ *
* Format of ZOS/MVS file list: 1 2 3 4 5 6 7 8 9 10 Volume Unit Referred
* Ext Used Recfm Lrecl BlkSz Dsorg Dsname B10142 3390 2006/03/20 2 31 F 80
* 80 PS MDI.OKL.WORK ARCIVE Not Direct Access Device
* KJ.IOP998.ERROR.PL.UNITTEST B1N231 3390 2006/03/20 1 15 VB 256 27998 PO
* PLU B1N231 3390 2006/03/20 1 15 VB 256 27998 PO-E PLB
- *
+ *
* ----------------------------------- Group within Regex [1] Volume [2]
* Unit [3] Referred [4] Ext: number of extents [5] Used [6] Recfm: Record
* format [7] Lrecl: Logical record length [8] BlkSz: Block size [9] Dsorg:
* Dataset organisation. Many exists but only support: PS, PO, PO-E [10]
* Dsname: Dataset name
- *
+ *
* Note: When volume is ARCIVE, it means the dataset is stored somewhere in
* a tape archive. These entries is currently not supported by this parser.
* A null value is returned.
- *
+ *
* @param file
* will be updated with Name, Type, Timestamp if parsed.
* @param entry zosDirectoryEntry
@@ -288,35 +288,35 @@ public class MVSFTPEntryParser extends C
// DSORG
if ("PS".equals(dsorg)) {
file.setType(FTPFile.FILE_TYPE);
- }
+ }
else if ("PO".equals(dsorg) || "PO-E".equals(dsorg)) {
// regex already ruled out anything other than PO or PO-E
file.setType(FTPFile.DIRECTORY_TYPE);
- }
+ }
else {
return false;
}
-
+
return true;
}
-
+
return false;
}
/**
* Parse entries within a partitioned dataset.
- *
+ *
* Format of a memberlist within a PDS: 1 2 3 4 5 6 7 8 9 Name VV.MM Created
* Changed Size Init Mod Id TBSHELF 01.03 2002/09/12 2002/10/11 09:37 11 11
* 0 KIL001 TBTOOL 01.12 2002/09/12 2004/11/26 19:54 51 28 0 KIL001
- *
+ *
* ------------------------------------------- [1] Name [2] VV.MM: Version .
* modification [3] Created: yyyy / MM / dd [4,5] Changed: yyyy / MM / dd
* HH:mm [6] Size: number of lines [7] Init: number of lines when first
* created [8] Mod: number of modified lines a last save [9] Id: User id for
* last update
- *
- *
+ *
+ *
* @param file
* will be updated with Name, Type and Timestamp if parsed.
* @param entry zosDirectoryEntry
@@ -347,7 +347,7 @@ public class MVSFTPEntryParser extends C
* Assigns the name to the first word of the entry. Only to be used from a
* safe context, for example from a memberlist, where the regex for some
* reason fails. Then just assign the name field of FTPFile.
- *
+ *
* @param file
* @param entry
* @return
@@ -365,7 +365,7 @@ public class MVSFTPEntryParser extends C
/**
* Parse the entry as a standard unix file. Using the UnixFTPEntryParser.
- *
+ *
* @param file
* @param entry
* @return true: entry is parsed, false: entry could not be parsed.
@@ -384,8 +384,8 @@ public class MVSFTPEntryParser extends C
* ------------------------------------------- Group in regex [1] Job name
* [2] Job number [3] Job status (INPUT,ACTIVE,OUTPUT) [4] Number of sysout
* files [5] The string "Spool Files"
- *
- *
+ *
+ *
* @param file
* will be updated with Name, Type and Timestamp if parsed.
* @param entry zosDirectoryEntry
@@ -413,8 +413,8 @@ public class MVSFTPEntryParser extends C
* ------------------------------------------- Group in regex [1] Job name
* [2] Job number [3] Owner [4] Job status (INPUT,ACTIVE,OUTPUT) [5] Job
* Class [6] The rest
- *
- *
+ *
+ *
* @param file
* will be updated with Name, Type and Timestamp if parsed.
* @param entry zosDirectoryEntry
@@ -466,15 +466,15 @@ public class MVSFTPEntryParser extends C
} else {
setType(UNKNOWN_LIST_TYPE);
}
-
+
if (isType != JES_LEVEL_1_LIST_TYPE) { // remove header is necessary
orig.remove(0);
}
}
-
+
return orig;
}
-
+
/**
* Explicitly set the type of listing being processed.
* @param type The listing type.
@@ -483,7 +483,7 @@ public class MVSFTPEntryParser extends C
isType = type;
}
- /*
+ /*
* @return
*/
@Override
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NTFTPEntryParser.java Mon Mar 14 17:09:59 2011
@@ -32,8 +32,8 @@ import org.apache.commons.net.ftp.FTPFil
*/
public class NTFTPEntryParser extends ConfigurableFTPFileEntryParserImpl
{
-
- private static final String DEFAULT_DATE_FORMAT
+
+ private static final String DEFAULT_DATE_FORMAT
= "MM-dd-yy hh:mma"; //11-09-01 12:30PM
private static final String DEFAULT_DATE_FORMAT2
@@ -63,10 +63,10 @@ public class NTFTPEntryParser extends Co
}
/**
- * This constructor allows the creation of an NTFTPEntryParser object
+ * This constructor allows the creation of an NTFTPEntryParser object
* with something other than the default configuration.
*
- * @param config The {@link FTPClientConfig configuration} object used to
+ * @param config The {@link FTPClientConfig configuration} object used to
* configure this parser.
* @exception IllegalArgumentException
* Thrown if the regular expression is unparseable. Should not be seen
@@ -149,7 +149,7 @@ public class NTFTPEntryParser extends Co
}
return null;
}
-
+
/**
* Defines a default configuration to be used when this class is
* instantiated without a {@link FTPClientConfig FTPClientConfig}
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/NetwareFTPEntryParser.java Mon Mar 14 17:09:59 2011
@@ -24,7 +24,7 @@ import org.apache.commons.net.ftp.FTPFil
/**
* Implementation of FTPFileEntryParser and FTPFileListParser for Netware Systems. Note that some of the proprietary
- * extensions for Novell-specific operations are not supported. See
+ * extensions for Novell-specific operations are not supported. See
* <a href="http://www.novell.com/documentation/nw65/index.html?page=/documentation/nw65/ftp_enu/data/fbhbgcfa.html">http://www.novell.com/documentation/nw65/index.html?page=/documentation/nw65/ftp_enu/data/fbhbgcfa.html</a>
* for more details.
*
@@ -49,7 +49,7 @@ public class NetwareFTPEntryParser exten
* this is the regular expression used by this parser.
* Example: d [-W---F--] SCION_VOL2 512 Apr 13 23:12 VOL2
*/
- private static final String REGEX = "(d|-){1}\\s+" // Directory/file flag
+ private static final String REGEX = "(d|-){1}\\s+" // Directory/file flag
+ "\\[(.*)\\]\\s+" // Attributes
+ "(\\S+)\\s+" + "(\\d+)\\s+" // Owner and size
+ "(\\S+\\s+\\S+\\s+((\\d+:\\d+)|(\\d{4})))" // Long/short date format
@@ -68,10 +68,10 @@ public class NetwareFTPEntryParser exten
}
/**
- * This constructor allows the creation of an NetwareFTPEntryParser object
+ * This constructor allows the creation of an NetwareFTPEntryParser object
* with something other than the default configuration.
*
- * @param config The {@link FTPClientConfig configuration} object used to
+ * @param config The {@link FTPClientConfig configuration} object used to
* configure this parser.
* @exception IllegalArgumentException
* Thrown if the regular expression is unparseable. Should not be seen
@@ -103,10 +103,10 @@ public class NetwareFTPEntryParser exten
* <li><b>F</b> - File Scan; Right to see directory or file listings.
* <li><b>A</b> - Access Control; Right to modify trustee assignments and the Inherited Rights Mask.
* </ul>
- *
- * See <a href="http://www.novell.com/documentation/nfap10/index.html?page=/documentation/nfap10/nfaubook/data/abxraws.html">here</a>
+ *
+ * See <a href="http://www.novell.com/documentation/nfap10/index.html?page=/documentation/nfap10/nfaubook/data/abxraws.html">here</a>
* for more details
- *
+ *
* @param entry A line of text from the file listing
* @return An FTPFile instance corresponding to the supplied entry
*/
@@ -143,7 +143,7 @@ public class NetwareFTPEntryParser exten
//set the size
f.setSize(Long.parseLong(size.trim()));
- // Now set the permissions (or at least a subset thereof - full permissions would probably require
+ // Now set the permissions (or at least a subset thereof - full permissions would probably require
// subclassing FTPFile and adding extra metainformation there)
if (attrib.indexOf("R") != -1) {
f.setPermission(FTPFile.USER_ACCESS, FTPFile.READ_PERMISSION,
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParser.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS2FTPEntryParser.java Mon Mar 14 17:09:59 2011
@@ -32,8 +32,8 @@ import org.apache.commons.net.ftp.FTPFil
public class OS2FTPEntryParser extends ConfigurableFTPFileEntryParserImpl
{
-
- private static final String DEFAULT_DATE_FORMAT
+
+ private static final String DEFAULT_DATE_FORMAT
= "MM-dd-yy HH:mm"; //11-09-01 12:30
/**
* this is the regular expression used by this parser.
@@ -59,10 +59,10 @@ public class OS2FTPEntryParser extends C
}
/**
- * This constructor allows the creation of an OS2FTPEntryParser object
+ * This constructor allows the creation of an OS2FTPEntryParser object
* with something other than the default configuration.
*
- * @param config The {@link FTPClientConfig configuration} object used to
+ * @param config The {@link FTPClientConfig configuration} object used to
* configure this parser.
* @exception IllegalArgumentException
* Thrown if the regular expression is unparseable. Should not be seen
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/OS400FTPEntryParser.java Mon Mar 14 17:09:59 2011
@@ -28,19 +28,19 @@ import org.apache.commons.net.ftp.FTPFil
public class OS400FTPEntryParser extends ConfigurableFTPFileEntryParserImpl
{
- private static final String DEFAULT_DATE_FORMAT
+ private static final String DEFAULT_DATE_FORMAT
= "yy/MM/dd HH:mm:ss"; //01/11/09 12:30:24
-
+
private static final String REGEX =
"(\\S+)\\s+" // user
+ "(\\d+)\\s+" // size
- + "(\\S+)\\s+(\\S+)\\s+" // date stuff
+ + "(\\S+)\\s+(\\S+)\\s+" // date stuff
+ "(\\*\\S+)\\s+" // *STMF/*DIR
+ "(\\S+/?)\\s*"; // filename
-
+
/**
* The default constructor for a OS400FTPEntryParser object.
*
@@ -55,10 +55,10 @@ public class OS400FTPEntryParser extends
}
/**
- * This constructor allows the creation of an OS400FTPEntryParser object
+ * This constructor allows the creation of an OS400FTPEntryParser object
* with something other than the default configuration.
*
- * @param config The {@link FTPClientConfig configuration} object used to
+ * @param config The {@link FTPClientConfig configuration} object used to
* configure this parser.
* @exception IllegalArgumentException
* Thrown if the regular expression is unparseable. Should not be seen
@@ -87,7 +87,7 @@ public class OS400FTPEntryParser extends
String datestr = group(3)+" "+group(4);
String typeStr = group(5);
String name = group(6);
-
+
try
{
file.setTimestamp(super.parseTimestamp(datestr));
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/RegexFTPFileEntryParserImpl.java Mon Mar 14 17:09:59 2011
@@ -90,7 +90,7 @@ public abstract class RegexFTPFileEntryP
}
/**
- * Convenience method
+ * Convenience method
*
* @return the number of groups() in the internal MatchResult.
*/
@@ -136,7 +136,7 @@ public abstract class RegexFTPFileEntryP
}
/**
- * Alter the current regular expression being utilised for entry parsing
+ * Alter the current regular expression being utilised for entry parsing
* and create a new {@link Pattern} instance.
* @param regex The new regular expression
* @return true if the compiled pattern is not null
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=1081476&r1=1081475&r2=1081476&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 Mar 14 17:09:59 2011
@@ -33,25 +33,25 @@ import org.apache.commons.net.ftp.FTPFil
*/
public class UnixFTPEntryParser extends ConfigurableFTPFileEntryParserImpl
{
-
- static final String DEFAULT_DATE_FORMAT
+
+ static final String DEFAULT_DATE_FORMAT
= "MMM d yyyy"; //Nov 9 2001
-
- static final String DEFAULT_RECENT_DATE_FORMAT
+
+ static final String DEFAULT_RECENT_DATE_FORMAT
= "MMM d HH:mm"; //Nov 9 20:06
- static final String NUMERIC_DATE_FORMAT
+ static final String NUMERIC_DATE_FORMAT
= "yyyy-MM-dd HH:mm"; //2001-11-09 20:06
/**
* Some Linux distributions are now shipping an FTP server which formats
- * file listing dates in an all-numeric format:
- * <code>"yyyy-MM-dd HH:mm</code>.
- * This is a very welcome development, and hopefully it will soon become
- * the standard. However, since it is so new, for now, and possibly
+ * file listing dates in an all-numeric format:
+ * <code>"yyyy-MM-dd HH:mm</code>.
+ * This is a very welcome development, and hopefully it will soon become
+ * the standard. However, since it is so new, for now, and possibly
* forever, we merely accomodate it, but do not make it the default.
* <p>
- * For now end users may specify this format only via
+ * For now end users may specify this format only via
* <code>UnixFTPEntryParser(FTPClientConfig)</code>.
* Steve Cohen - 2005-04-17
*/
@@ -97,12 +97,12 @@ public class UnixFTPEntryParser extends
* diacritics (e.g. umlaut) in some abbreviations.
*/
+ "((?:\\d+[-/]\\d+[-/]\\d+)|(?:\\S{3}\\s+\\d{1,2})|(?:\\d{1,2}\\s+\\S{3}))\\s+"
- /*
+ /*
year (for non-recent standard format) - yyyy
- or time (for numeric or recent standard format) [h]h:mm
+ or time (for numeric or recent standard format) [h]h:mm
*/
+ "(\\d+(?::\\d+)?)\\s+"
-
+
+ "(\\S*)(\\s*.*)"; // the rest
@@ -123,7 +123,7 @@ public class UnixFTPEntryParser extends
* This constructor allows the creation of a UnixFTPEntryParser object with
* something other than the default configuration.
*
- * @param config The {@link FTPClientConfig configuration} object used to
+ * @param config The {@link FTPClientConfig configuration} object used to
* configure this parser.
* @exception IllegalArgumentException
* Thrown if the regular expression is unparseable. Should not be seen
@@ -173,10 +173,10 @@ public class UnixFTPEntryParser extends
{
// intentionally do nothing
}
-
+
// A 'whiteout' file is an ARTIFICIAL entry in any of several types of
// 'translucent' filesystems, of which a 'union' filesystem is one.
-
+
// bcdelfmpSs-
switch (typeStr.charAt(0))
{
@@ -247,7 +247,7 @@ public class UnixFTPEntryParser extends
{
// intentionally do nothing
}
-
+
if (null == endtoken)
{
file.setName(name);
@@ -297,5 +297,5 @@ public class UnixFTPEntryParser extends
DEFAULT_RECENT_DATE_FORMAT,
null, null, null);
}
-
+
}
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSFTPEntryParser.java Mon Mar 14 17:09:59 2011
@@ -49,7 +49,7 @@ import org.apache.commons.net.ftp.FTPFil
public class VMSFTPEntryParser extends ConfigurableFTPFileEntryParserImpl
{
- private static final String DEFAULT_DATE_FORMAT
+ private static final String DEFAULT_DATE_FORMAT
= "d-MMM-yyyy HH:mm:ss"; //9-NOV-2001 12:30:24
/**
@@ -82,7 +82,7 @@ public class VMSFTPEntryParser extends C
* This constructor allows the creation of a VMSFTPEntryParser object with
* something other than the default configuration.
*
- * @param config The {@link FTPClientConfig configuration} object used to
+ * @param config The {@link FTPClientConfig configuration} object used to
* configure this parser.
* @exception IllegalArgumentException
* Thrown if the regular expression is unparseable. Should not be seen
@@ -178,11 +178,11 @@ public class VMSFTPEntryParser extends C
f.setUser(user);
//set group and owner
- //Set file permission.
+ //Set file permission.
//VMS has (SYSTEM,OWNER,GROUP,WORLD) users that can contain
//R (read) W (write) E (execute) D (delete)
- //iterate for OWNER GROUP WORLD permissions
+ //iterate for OWNER GROUP WORLD permissions
for (int access = 0; access < 3; access++)
{
String permission = permissions[access];
@@ -235,7 +235,7 @@ public class VMSFTPEntryParser extends C
protected boolean isVersioning() {
return false;
}
-
+
/**
* Defines a default configuration to be used when this class is
* instantiated without a {@link FTPClientConfig FTPClientConfig}
Modified: commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSVersioningFTPEntryParser.java
URL: http://svn.apache.org/viewvc/commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSVersioningFTPEntryParser.java?rev=1081476&r1=1081475&r2=1081476&view=diff
==============================================================================
--- commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSVersioningFTPEntryParser.java (original)
+++ commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/parser/VMSVersioningFTPEntryParser.java Mon Mar 14 17:09:59 2011
@@ -66,10 +66,10 @@ public class VMSVersioningFTPEntryParser
}
/**
- * This constructor allows the creation of a VMSVersioningFTPEntryParser
+ * This constructor allows the creation of a VMSVersioningFTPEntryParser
* object with something other than the default configuration.
*
- * @param config The {@link FTPClientConfig configuration} object used to
+ * @param config The {@link FTPClientConfig configuration} object used to
* configure this parser.
* @exception IllegalArgumentException
* Thrown if the regular expression is unparseable. Should not be seen