Package org.sd_network.vfs.db

Examples of org.sd_network.vfs.db.SystemInfo


        if (!file.canRead()) {
            System.out.println("ERROR: the file access denied.");
            return;
        }

        SystemInfo systemInfo = vfsService.getSystemInfo();
        String parentFileID = session.getCurrentDirectory().getID();
        String fileSessionID = null;
        try {
            VfsFile vfsFile = vfsService.createFile(
                    sessionID, parentFileID, cl.getArgs()[1]);

            if (vfsService.isExistsName(
                        sessionID, vfsFile.getID(), cl.getArgs()[1]))
            {
                System.out.println("ERROR: the vfs_file_name already used.");
                return;
            }

            fileSessionID = vfsService.createFileSession(
                    sessionID, vfsFile.getID(), FileSession.Mode.WRITE);

            byte[] buf = new byte[systemInfo.getBytesPerWrite()];
            FileInputStream fis = null;
            try {
                fis = new FileInputStream(file);
                int count = 0;
                while ((count = fis.read(buf)) != -1)
View Full Code Here


        if (file.exists()) {
            System.out.println("ERROR: the local file already exists.");
            return;
        }

        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);
                int count = 0;
                while ((count = vfsService.readData(sessionID, fileSessionID, buf, buf.length)) != -1)
View Full Code Here

TOP

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

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.