1 16 package org.apache.commons.net.ftp.parser; 17 18 import org.apache.commons.net.ftp.FTPClientConfig; 19 import org.apache.commons.net.ftp.FTPFile; 20 21 29 public class MVSFTPEntryParser extends ConfigurableFTPFileEntryParserImpl 30 { 31 34 private static final String REGEX = "(.*)\\s+([^\\s]+)\\s*"; 35 36 42 static final String DEFAULT_DATE_FORMAT 43 = "yyyy/MM/dd"; 45 46 63 70 78 public MVSFTPEntryParser() 79 { 80 super(REGEX); 81 } 82 83 93 public FTPFile parseFTPEntry(String entry) 94 { 95 FTPFile f = null; 96 if (matches(entry)) 97 { 98 f = new FTPFile(); 99 String dataSetName = group(2); 100 f.setType(FTPFile.FILE_TYPE); 101 f.setName(dataSetName); 102 103 return (f); 104 } 105 return null; 106 } 107 108 111 protected FTPClientConfig getDefaultConfiguration() { 112 return new FTPClientConfig( 113 FTPClientConfig.SYST_MVS, 114 DEFAULT_DATE_FORMAT, 115 null, null, null, null); 116 } 117 } 118 | Popular Tags |