]> git.basschouten.com Git - openhab-addons.git/blob
d48c78795658468bac5c9952421902cc6309fdd6
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.ftpupload.internal.ftp;
14
15 import org.apache.ftpserver.ftplet.FileSystemView;
16 import org.apache.ftpserver.ftplet.FtpException;
17 import org.apache.ftpserver.ftplet.FtpFile;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
20
21 /**
22  * Simple FTP file system view implementation.
23  *
24  *
25  * @author Pauli Anttila - Initial contribution
26  */
27 public class SimpleFileSystemView implements FileSystemView {
28     private Logger logger = LoggerFactory.getLogger(SimpleFileSystemView.class);
29
30     SimpleFtpFile file = new SimpleFtpFile();
31
32     @Override
33     public boolean changeWorkingDirectory(String arg0) throws FtpException {
34         logger.trace("changeWorkingDirectory: {}", arg0);
35         return true;
36     }
37
38     @Override
39     public void dispose() {
40         logger.trace("dispose");
41     }
42
43     @Override
44     public FtpFile getFile(String arg0) throws FtpException {
45         logger.trace("getFile: {}", arg0);
46         return file;
47     }
48
49     @Override
50     public FtpFile getHomeDirectory() throws FtpException {
51         logger.trace("getHomeDirectory");
52         return new SimpleFtpFile();
53     }
54
55     @Override
56     public FtpFile getWorkingDirectory() throws FtpException {
57         logger.trace("getWorkingDirectory");
58         return new SimpleFtpFile();
59     }
60
61     @Override
62     public boolean isRandomAccessible() throws FtpException {
63         logger.trace("isRandomAccessible");
64         return false;
65     }
66 }