Examples of Dupe


Examples of cu.ftpd.modules.dupecheck.Dupe

    public boolean handleEvent(Event event, Connection connection) {
        final String path = event.getProperty("file.path.ftp");
        String filename = FileSystem.getNameFromPath(path);
        String parentDirectory = FileSystem.getParentDirectoryFromPath(path);
        if (ServiceManager.getServices().getPermissions().shouldLog(ActionPermission.DUPECHECK, parentDirectory, event.getUser())) {
            Dupe dupe = dupelog.getDupe(filename);
            if (dupe != null) {
                // wouldn't it be nice (and memory intensive) to have the path to the file here too?
                // the problem is that whenever it was moved, we'd have to update the object =(
                connection.respond("553 This looks like a dupe! It was uploaded by " + dupe.getUsername() + ' ' + Formatter.shortDuration((System.currentTimeMillis() - dupe.getTime()) / 1000) + " ago");
                return false;
            } // if it returns null, we're happy
        }
        return true;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.