Add callback for delete operation.
[cyberduck.git] / source / ch / cyberduck / core / ftp / FTPParserSelector.java
blobe42d688f82da203d3f984ad5d0e426ec899644c5
1 package ch.cyberduck.core.ftp;
3 /*
4 * Copyright (c) 2002-2013 David Kocher. All rights reserved.
5 * http://cyberduck.ch/
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;
27 /**
28 * @version $Id$
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;
42 if(null == zone) {
43 parser = new FTPParserFactory().createFileEntryParser(system,
44 TimeZone.getTimeZone(PreferencesFactory.get().getProperty("ftp.timezone.default")));
46 else {
47 parser = new FTPParserFactory().createFileEntryParser(system, zone);
49 // Configure timezone
50 parser.configure(null);
51 return parser;