Package org.sd_network.vfs.db

Examples of org.sd_network.vfs.db.VfsFile


        if (userSession == null)
            throw new SessionException("Invalid session.");
        User user = userSession.getUser();

        // retrive parent object.
        VfsFile parent = VfsFileDB.get(parentFileID, user.getID());
        if (parent == null)
            throw new VfsIOException("The parent not found.");

        // check already exists same name.
        return (VfsFileDB.get(parent.getID(), fileName, user.getID()) != null);
    }
View Full Code Here


        SystemInfo systemInfo = vfsService.getSystemInfo();
        String parentFileID = session.getCurrentDirectory().getID();
        String fileSessionID = null;
        try {

            VfsFile vfsFile = vfsService.getVfsFile(
                    sessionID, parentFileID, cl.getArgs()[0]);
            if (vfsFile == null) {
                System.out.println("ERROR: the VfsFile not found.");
                return;
            }
            fileSessionID = vfsService.createFileSession(
                sessionID, vfsFile.getID(), FileSession.Mode.READ);

            byte[] buf = new byte[systemInfo.getBytesPerRead()];
            FileOutputStream fos = null;
            try {
                fos = new FileOutputStream(file);
View Full Code Here

        } catch (ParseException e) {
            printUsage(e.getMessage());
            return;
        }

        VfsFile parent = session.getCurrentDirectory();

        try {
            VfsFile[] children =
                vfsService.getVfsFiles(sessionID, parent.getID());
            for (int idx = 0; idx < children.length; idx++) {
                VfsFile child = children[idx];
                StringBuffer sb = new StringBuffer();
                if (child.getType() == VfsFile.FileType.DIRECTORY)
                    sb.append("D ");
                else
                    sb.append("F ");
                sb.append(child.getName()).append("  ");
                sb.append(child.getSize()).append("  ");
                sb.append(child.getCreated());
                System.out.println(sb.toString());
            }
        } catch (SessionException e) {
            session.clearSessionID();
            throw new IllegalStateException("ERROR: Session time out.");
View Full Code Here

TOP

Related Classes of org.sd_network.vfs.db.VfsFile

Copyright © 2018 www.massapicom. 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.