Package org.apache.commons.net.ftp

Examples of org.apache.commons.net.ftp.FTPClientConfig


   * entry necessitated changing the regex in the parser.
   *
   */
  public void testParseEntryWithSymlink() {
   
    FTPClientConfig config = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
    config.setDefaultDateFormatStr("yyyy-MM-dd HH:mm");

    UnixFTPEntryParser parser = new UnixFTPEntryParser();
    parser.configure(config);

    FTPFile f = parser.parseFTPEntry("lrwxrwxrwx   1 neeme neeme    23 2005-03-02 18:06 macros");
View Full Code Here


   
    FTPTimestampParserImpl parser = new FTPTimestampParserImpl();

    // assume we are FTPing a server in Chicago, two hours ahead of
    // L. A.
    FTPClientConfig config =
        new FTPClientConfig(FTPClientConfig.SYST_UNIX);
    config.setDefaultDateFormatStr(FTPTimestampParser.DEFAULT_SDF);
    config.setRecentDateFormatStr(FTPTimestampParser.DEFAULT_RECENT_SDF);
      // 2 hours difference
    config.setServerTimeZoneId("America/Chicago");
    parser.configure(config);
   
    SimpleDateFormat sdf = (SimpleDateFormat)
      parser.getRecentDateFormat().clone();
   
View Full Code Here

      fail("should.have.failed.to.parse.default");
    } catch (ParseException e) {
      // this is the success case
    }

    FTPClientConfig config = new FTPClientConfig();
    config.setDefaultDateFormatStr("d MMM yyyy");
    config.setRecentDateFormatStr("d MMM HH:mm");
    config.setServerLanguageCode("fr");
    parser.configure(config);
    try {
      parser.parseTimestamp("d\u00e9c 22 2002");
      fail("incorrect.field.order");
    } catch (ParseException e) {
View Full Code Here

    /*
     * @return
     */
    protected FTPClientConfig getDefaultConfiguration() {
        return new FTPClientConfig(
                FTPClientConfig.SYST_MVS,
                DEFAULT_DATE_FORMAT,
                null, null, null, null);
    }
View Full Code Here

     * instantiated without a {@link  FTPClientConfig  FTPClientConfig}
     * parameter being specified.
     * @return the default configuration for this parser.
     */
    protected FTPClientConfig getDefaultConfiguration() {
        return new FTPClientConfig(
                FTPClientConfig.SYST_UNIX,
                DEFAULT_DATE_FORMAT,
                DEFAULT_RECENT_DATE_FORMAT,
                null, null, null);
    }
View Full Code Here

     * instantiated without a {@link  FTPClientConfig  FTPClientConfig}
     * parameter being specified.
     * @return the default configuration for this parser.
     */
   protected FTPClientConfig getDefaultConfiguration() {
        return new FTPClientConfig(
                FTPClientConfig.SYST_VMS,
                DEFAULT_DATE_FORMAT,
                null, null, null, null);
    }
View Full Code Here

     * instantiated without a {@link  FTPClientConfig  FTPClientConfig}
     * parameter being specified.
     * @return the default configuration for this parser.
     */
   public FTPClientConfig getDefaultConfiguration() {
        return new FTPClientConfig(
                FTPClientConfig.SYST_NT,
                DEFAULT_DATE_FORMAT,
                null, null, null, null);
    }
View Full Code Here

   * each concrete subclass is used instead.
   */
    public void configure(FTPClientConfig config)
    {
        if (this.timestampParser instanceof Configurable) {
            FTPClientConfig defaultCfg = getDefaultConfiguration();
          if (config != null) {
              if (null == config.getDefaultDateFormatStr()) {
                  config.setDefaultDateFormatStr(defaultCfg.getDefaultDateFormatStr());
              }
              if (null == config.getRecentDateFormatStr()) {
                  config.setRecentDateFormatStr(defaultCfg.getRecentDateFormatStr());
              }
              ((Configurable)this.timestampParser).configure(config);
          } else {
              ((Configurable)this.timestampParser).configure(defaultCfg);
          }
View Full Code Here

     * instantiated without a {@link  FTPClientConfig  FTPClientConfig}
     * parameter being specified.
     * @return the default configuration for this parser.
     */
    protected FTPClientConfig getDefaultConfiguration() {
        return new FTPClientConfig(
                FTPClientConfig.SYST_OS400,
                DEFAULT_DATE_FORMAT,
                null, null, null, null);
    }
View Full Code Here

     * instantiated without a {@link  FTPClientConfig  FTPClientConfig}
     * parameter being specified.
     * @return the default configuration for this parser.
     */
    protected FTPClientConfig getDefaultConfiguration() {
        return new FTPClientConfig(
                FTPClientConfig.SYST_OS2,
                DEFAULT_DATE_FORMAT,
                null, null, null, null);
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.net.ftp.FTPClientConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.