Skip to content
Snippets Groups Projects
Commit 0db33b3e authored by fabiovandewaeter's avatar fabiovandewaeter
Browse files

refactoring

parent be082b29
Branches
Tags
No related merge requests found
......@@ -10,6 +10,8 @@ import java.util.Map;
import java.util.HashMap;
import java.util.ArrayList;
import fil.sr2.flopbox.utils.*;
@Path("/ftps")
public class FTPResource {
......@@ -54,6 +56,7 @@ public class FTPResource {
@PathParam("path") String searchTerm,
@HeaderParam("X-FTP-User") String user,
@HeaderParam("X-FTP-Pass") String pass) {
System.out.println("searchFiles()");
List<FTPServerConfig> servers = FTPServerRepository.getInstance().getAllServers();
Map<String, List<String>> results = new HashMap<>();
......
......@@ -2,6 +2,8 @@ package fil.sr2.flopbox;
import java.util.*;
import fil.sr2.flopbox.utils.*;
public class FTPServerRepository {
private static FTPServerRepository instance = new FTPServerRepository();
private Map<String, FTPServerConfig> serverMap = new HashMap<>();
......
......@@ -15,6 +15,8 @@ import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.io.ByteArrayInputStream;
import fil.sr2.flopbox.utils.*;
public class FTPService {
public FtpNode getResourceTree(String alias, String path, String user, String pass)
......
package fil.sr2.flopbox;
package fil.sr2.flopbox.utils;
import java.io.IOException;
import java.util.HashMap;
......
package fil.sr2.flopbox;
package fil.sr2.flopbox.utils;
import org.apache.commons.net.ftp.FTPClient;
import java.io.IOException;
import fil.sr2.flopbox.FTPServerRepository;
public class FTPClientFactory {
public static FTPClient createClient(String alias) throws FTPException {
......
package fil.sr2.flopbox;
package fil.sr2.flopbox.utils;
public class FTPException extends Exception {
private final int status;
......
package fil.sr2.flopbox;
package fil.sr2.flopbox.utils;
public class FTPServerConfig {
private String alias;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment