1 package ch
.cyberduck
.core
.ftp
;
4 * Copyright (c) 2002-2013 David Kocher. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * Bug fixes, suggestions and comments should be sent to feedback@cyberduck.ch
20 import ch
.cyberduck
.core
.ftp
.parser
.CompositeFileEntryParser
;
21 import ch
.cyberduck
.core
.preferences
.PreferencesFactory
;
23 import org
.apache
.log4j
.Logger
;
25 import java
.util
.TimeZone
;
30 public class FTPParserSelector
{
31 private static final Logger log
= Logger
.getLogger(FTPParserSelector
.class);
33 public CompositeFileEntryParser
getParser(final String system
) {
34 return this.getParser(system
, null);
37 public CompositeFileEntryParser
getParser(final String system
, final TimeZone zone
) {
38 if(log
.isDebugEnabled()) {
39 log
.debug(String
.format("Select parser for system %s in zone %s", system
, zone
));
41 final CompositeFileEntryParser parser
;
43 parser
= new FTPParserFactory().createFileEntryParser(system
,
44 TimeZone
.getTimeZone(PreferencesFactory
.get().getProperty("ftp.timezone.default")));
47 parser
= new FTPParserFactory().createFileEntryParser(system
, zone
);
50 parser
.configure(null);