Examples of FileIOException


Examples of net.rim.device.api.io.file.FileIOException

        FileConnectionWrapper fConnWrap = null;
        try {
            fConnWrap = new FileConnectionWrapper( args[ 0 ].toString() );

            if( !fConnWrap.exists() ) {
                throw new FileIOException( FileIOException.DIRECTORY_NOT_FOUND );
            }

            if( !fConnWrap.isDirectory() ) {
                throw new FileIOException( FileIOException.NOT_A_DIRECTORY );
            }

            if( args[ 1 ].toString().length() == 0 ) {
                throw new FileIOException( FileIOException.NOT_A_DIRECTORY );
            }

            fConnWrap.getFileConnection().rename( args[ 1 ].toString() );
        } finally {
            if( fConnWrap != null ) {
View Full Code Here

Examples of net.rim.device.api.io.file.FileIOException

                try {
                    con.close();
                } catch( Exception e ) {
                }
            }
            throw new FileIOException( FileIOException.INVALID_PARAMETER );
        }
    }
View Full Code Here

Examples of net.rim.device.api.io.file.FileIOException

        try {
            fConnWrap = new FileConnectionWrapper( args[ 0 ].toString() );

            if( !fConnWrap.exists() ) {
                throw new FileIOException( FileIOException.FILENAME_NOT_FOUND );
            }

            parentDir = "file://" + fConnWrap.getFileConnection().getPath();
        } finally {
            if( fConnWrap != null ) {
View Full Code Here

Examples of net.rim.device.api.io.file.FileIOException

        FileConnectionWrapper fConnWrap = null;
        try {
            fConnWrap = new FileConnectionWrapper( args[ 0 ].toString() );

            if( !fConnWrap.exists() ) {
                throw new FileIOException( FileIOException.FILENAME_NOT_FOUND );
            }

            if( fConnWrap.isDirectory() ) {
                throw new FileIOException( FileIOException.NOT_A_FILE );
            }

            fConnWrap.getFileConnection().rename( args[ 1 ].toString() );
        } finally {
            if( fConnWrap != null ) {
View Full Code Here

Examples of net.rim.device.api.io.file.FileIOException

        FileConnectionWrapper fConnWrap = null;
        try {
            fConnWrap = new FileConnectionWrapper( args[ 0 ].toString() );

            if( !fConnWrap.exists() ) {
                throw new FileIOException( FileIOException.DIRECTORY_NOT_FOUND );
            }
            if( !fConnWrap.isDirectory() ) {
                throw new FileIOException( FileIOException.NOT_A_DIRECTORY );
            }

            // Delete all the contents of the directory if the flag is set
            if( args.length > 1 && args[ 1 ] instanceof Boolean && args[ 1 ].toString().equals( "true" ) ) {
                deleteEntireDirectory( fConnWrap );
View Full Code Here

Examples of net.rim.device.api.io.file.FileIOException

            dis = fconnWrapIn.openDataInputStream();

            fconnWrapOut = new FileConnectionWrapper( args[ 1 ].toString() );

            if( fconnWrapOut.isDirectory() ) {
                throw new FileIOException( FileIOException.NOT_A_FILE );
            }

            fconnWrapOut.create();
            dos = fconnWrapOut.openDataOutputStream();
View Full Code Here

Examples of net.rim.device.api.io.file.FileIOException

        FileConnectionWrapper fConnWrap = null;
        try {
            fConnWrap = new FileConnectionWrapper( args[ 0 ].toString() );

            if( fConnWrap.isDirectory() ) {
                throw new FileIOException( FileIOException.NOT_A_FILE );
            }

            fConnWrap.delete();
        } finally {
            if( fConnWrap != null ) {
View Full Code Here

Examples of net.sf.joafip.file.service.FileIOException

  static public EnumFileState fileState(final Exception exception) {
    return HeapFileStateHelper.fileState(exception);
  }

  static public FileIOException fileIOException(final Exception exception) {
    FileIOException fileIOException = null;
    Throwable current = exception;
    while (fileIOException == null && current != null) {
      if (current instanceof FileIOException) {
        fileIOException = (FileIOException) current;
      }
View Full Code Here

Examples of org.apache.roller.business.FileIOException

        }
       
        // make sure we are allowed to save this file
        RollerMessages msgs = new RollerMessages();
        if (!canSave(weblog, savePath, contentType, size, msgs)) {
            throw new FileIOException(msgs.toString());
        }
       
        // make sure uploads area exists for this weblog
        File dirPath = this.getRealFile(weblog, null);
        File saveFile = new File(dirPath.getAbsolutePath() + File.separator + savePath);
       
        byte[] buffer = new byte[8192];
        int bytesRead = 0;
        OutputStream bos = null;
        try {
            bos = new FileOutputStream(saveFile);
            while ((bytesRead = is.read(buffer, 0, 8192)) != -1) {
                bos.write(buffer, 0, bytesRead);
            }
           
            log.debug("The file has been written to ["+saveFile.getAbsolutePath()+"]");
        } catch (Exception e) {
            throw new FileIOException("ERROR uploading file", e);
        } finally {
            try {
                bos.flush();
                bos.close();
            } catch (Exception ignored) {}
View Full Code Here

Examples of org.apache.roller.business.FileIOException

        }
       
        // create it
        if(!dir.mkdir()) {
            // failed for some reason
            throw new FileIOException("Failed to create directory ["+path+"], "+
                    "probably doesn't have needed parent directories.");
        }
    }
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.