Package org.apache.commons.net.ftp

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


     */
     public NTFTPEntryParser(FTPClientConfig config)
    {
        super(REGEX);
        configure(config);
        FTPClientConfig config2 = new FTPClientConfig(
                FTPClientConfig.SYST_NT,
                DEFAULT_DATE_FORMAT2,
                null, null, null, null);
        config2.setDefaultDateFormatStr(DEFAULT_DATE_FORMAT2);
        this.timestampParser = new FTPTimestampParserImpl();
        ((Configurable)this.timestampParser).configure(config2);
    }
View Full Code Here


     * parameter being specified.
     * @return the default configuration for this parser.
     */
    @Override
    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

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

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

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

    private SimpleDateFormat df = new SimpleDateFormat();

    public void testParseFieldsOnAIX() {

        // Set a date format for this server type
        FTPClientConfig config = new FTPClientConfig(FTPClientConfig.SYST_UNIX);
        config.setDefaultDateFormatStr("dd MMM HH:mm");

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

        FTPFile f = parser.parseFTPEntry("-rw-r-----   1 ravensm  sca          814 02 Mar 16:27 ZMIR2.m");
View Full Code Here

     * 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

            assertTrue(root instanceof InstantiationException);
        }
    }

    private void checkParserClass(FTPFileEntryParserFactory fact, String key, Class<?> expected){
        FTPClientConfig config = key == null ? new FTPClientConfig() : new FTPClientConfig(key);
        FTPFileEntryParser parser = fact.createFileEntryParser(config);
        assertNotNull(parser);
        assertTrue("Expected "+expected.getCanonicalName()+" got "+parser.getClass().getCanonicalName(),
                expected.isInstance(parser));
    }
View Full Code Here

            is.close();
            File list = new File(mlsd.getParentFile(),mlsd.getName().replace("_mlsd", "_list"));

            System.out.println(list);
            is = new FileInputStream(list);
            FTPClientConfig cfg = new FTPClientConfig();
            cfg.setServerTimeZoneId("GMT");
            UnixFTPEntryParser parser = new UnixFTPEntryParser(cfg);
            engine = new FTPListParseEngine(parser);
            engine.readServerList(is, FTP.DEFAULT_CONTROL_ENCODING);
            FTPFile [] lists = engine.getFiles(FTPFileFilters.ALL);
            is.close();
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.