Package kameleon.exception

Examples of kameleon.exception.FileReadingException


  public static Object readObjectFromFile(String filePath) throws FileReadingException {
    File sourceFile = new File(filePath) ;
    try {
      return readObjectFromFile(new FileInputStream(sourceFile)) ;
    } catch (IOException e) {
      throw new FileReadingException(sourceFile) ;
    }// try
  }// readObjectFromFile(String)
View Full Code Here


  public static Object readObjectFromFile(InputStream in) throws FileReadingException {
    try {
      ObjectInputStream oin = new ObjectInputStream(in) ;
      return oin.readObject() ;
    } catch (IOException e) {
      throw new FileReadingException() ;
    } catch (ClassNotFoundException e) {
      //TODO Find better solution ?
      throw new FileReadingException() ;
    }// try
  }// readObjectFromFile(InputStream)
View Full Code Here

     
      return info ;
    } catch (ZipException e) {
      throw new InvalidPlugInException(plugin.getName()) ;
    } catch (IOException e) {
      throw new FileReadingException(plugin) ;
    }// try
  }// addPlugIn(File, String, String, String)
View Full Code Here

    InputStream src ;
    try {
      src = new BufferedInputStream(
          new FileInputStream(pluginFile)) ;
    } catch (IOException e) {
      throw new FileReadingException() ;
    }// try
    OutputStream dest ;
    try {
      dest = new BufferedOutputStream(
          new FileOutputStream(String.format(PATH_EXTENSION,
              tagetFolder, jarName))) ;
    } catch (IOException e) {
      throw new FileWritingException() ;
    }// try

    /* Do the actual copying */
    IOFile.copyFile(src, dest) ;

    /* Close the streams */
    try {
      src.close() ;
    } catch (IOException e) {
      throw new FileReadingException() ;
    }// try
    try {
      dest.close() ;
    } catch (IOException e) {
      throw new FileWritingException() ;
View Full Code Here

    BufferedInputStream input ;
    BufferedOutputStream output ;
    try {
      input = new BufferedInputStream(new FileInputStream(source)) ;
    } catch (FileNotFoundException e) {
      throw new FileReadingException(source) ;
    }// try
    try {
      output = new BufferedOutputStream(new FileOutputStream(target)) ;
    } catch (FileNotFoundException e) {
      throw new FileWritingException(target) ;
    }// try
   
    // Do the actual copying
    copyFile(input, output) ;
   
    // Closing the streams
    try {
      output.close() ;
    } catch (IOException e) {
      throw new FileWritingException(source) ;
    }// try
    try {
      input.close() ;
    } catch (IOException e) {
      throw new FileReadingException(source) ;
    }// try
  }// copyFile(File, File)
View Full Code Here

   */
  private static final int read(InputStream source, byte[] buffer) throws FileReadingException {
    try {
      return source.read(buffer, 0, buffer.length) ;
    } catch (IOException e) {
      throw new FileReadingException() ;
    }// try
  }// read(InputStream, byte[])
View Full Code Here

   */
  public static Document readFromFile(File source) throws FileReadingException {
    try {
      return readFromFile(new FileInputStream(source)) ;
    } catch (IOException e) {
      throw new FileReadingException(source) ;
    }// try
  }// readFromFile(File)
View Full Code Here

      InputStream src ;
      OutputStream dest ;
      String picLocation = String.format(PICTURE_LOCATION, pictureName) ;
      src = this.getClass().getResourceAsStream(picLocation) ;
      if (src == null) {
        throw new FileReadingException(new File(picLocation)) ;
      }// if
      src = new BufferedInputStream(src) ;
     
      File targetFile = new File(String.format(PATH_EXTENSION, targetFolder, pictureName)) ;
      try {
View Full Code Here

        ImageUtility.getImageBytes(src))) ;
    try {
      src.close() ;
    } catch(IOException ioe) {
      this.model.displayDebugInformation(
          new FileReadingException(ioe.getMessage())) ;
    }// try
  }// initProgressIcon(JLabel, State)
View Full Code Here

    iconLabel.setIcon(new ImageIcon(ImageUtility.getImageBytes(src))) ;
    try {
      src.close() ;
    } catch(IOException ioe) {
      this.model.displayDebugInformation(
          new FileReadingException(ioe.getMessage())) ;
    }// try
  }// initIcon(JLabel, State)
View Full Code Here

TOP

Related Classes of kameleon.exception.FileReadingException

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.