Examples of IOExceptionWithCause


Examples of org.apache.commons.io.IOExceptionWithCause

       
        if ( log.isDebugEnabled() ) {
          log.debug("readRdfWithCheckingUtf8: " +errorMessage);
        }
       
        throw new IOExceptionWithCause(errorMessage, jenaExc);
      }
     
      // the following verifyUtf8 was done before I wrote and called the getXmlParseExceptionErrorMessage
      // method above;   just keeping the verifyUtf8 here although perhaps it's redundant:
     
      // perhaps because not UTF-8? Try the check directly:
      try {
        Utf8Util.verifyUtf8(file);
      }
      catch (Exception utfExc) {
        // yes, it seems the problem is the encoding
        String error = jenaExc.getMessage();
        jenaExc.printStackTrace();
        throw new IOExceptionWithCause(error, jenaExc);
      }

      // other kind of problem:
      String error = jenaExc.getClass().getName()+ " : " +jenaExc.getMessage();
      throw new IOException(error);
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

    }
    catch ( Throwable jenaExc ) {
      // XML parse exception?
      String errorMessage = getXmlParseExceptionErrorMessage(jenaExc);
      if ( errorMessage != null ) {
        throw new IOExceptionWithCause(errorMessage, jenaExc);
      }
     
      // the following verifyUtf8 was done before I wrote and called the getXmlParseExceptionErrorMessage
      // method above;   just keeping the verifyUtf8 here although perhaps it's redundant:
     
      // perhaps because not UTF-8? Try the check directly:
      try {
        Utf8Util.verifyUtf8(file);
      }
      catch (Exception utfExc) {
        // yes, it seems the problem is the encoding"
        String error = jenaExc.getMessage();
        throw new IOExceptionWithCause(error, utfExc);
      }

      // other kind of problem:
      String error = jenaExc.getClass().getName()+ " : " +jenaExc.getMessage();
      throw new IOExceptionWithCause(error, jenaExc);
   
  }
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

    public static Name indexToName(int index) throws IOException {
        try {
            return NAME_ARRAY[index];
        } catch (ArrayIndexOutOfBoundsException e) {
            throw new IOExceptionWithCause(
                    "Invalid common JCR name index: " + index, e);
        }
    }
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

        try {
          // 尝试加载为ZIP文件
          ZipFile zipFile = new ZipFile(bundleFile);
          zipFile.close();
        } catch (IOException ex) {
          throw new IOExceptionWithCause(String.format(
              "将文件[%s]作为ZIP文件打开时出错!", bundleFile.getName()), ex);
        }
        bundleInputStreams[i] = new FileInputStream(bundleFile);
      }
      Bundle[] bundles = installOrUpdateBundle(bundleContext,
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

        try {
          // 尝试加载为ZIP文件
          ZipFile zipFile = new ZipFile(bundleFile);
          zipFile.close();
        } catch (IOException ex) {
          throw new IOExceptionWithCause(String.format(
              "将文件[%s]作为ZIP文件打开时出错!", bundleFile.getName()), ex);
        }
        bundleInputStreams[i] = new FileInputStream(bundleFile);
      }
      Bundle[] bundles = installOrUpdateBundle(bundleContext,
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

       
        if ( log.isDebugEnabled() ) {
          log.debug("readRdfWithCheckingUtf8: " +errorMessage);
        }
       
        throw new IOExceptionWithCause(errorMessage, jenaExc);
      }
     
      // the following verifyUtf8 was done before I wrote and called the getXmlParseExceptionErrorMessage
      // method above;   just keeping the verifyUtf8 here although perhaps it's redundant:
     
      // perhaps because not UTF-8? Try the check directly:
      try {
        Utf8Util.verifyUtf8(file);
      }
      catch (Exception utfExc) {
        // yes, it seems the problem is the encoding
        String error = jenaExc.getMessage();
        jenaExc.printStackTrace();
        throw new IOExceptionWithCause(error, jenaExc);
      }

      // other kind of problem:
      String error = jenaExc.getClass().getName()+ " : " +jenaExc.getMessage();
      throw new IOException(error);
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

    }
    catch ( Throwable jenaExc ) {
      // XML parse exception?
      String errorMessage = getXmlParseExceptionErrorMessage(jenaExc);
      if ( errorMessage != null ) {
        throw new IOExceptionWithCause(errorMessage, jenaExc);
      }
     
      // the following verifyUtf8 was done before I wrote and called the getXmlParseExceptionErrorMessage
      // method above;   just keeping the verifyUtf8 here although perhaps it's redundant:
     
      // perhaps because not UTF-8? Try the check directly:
      try {
        Utf8Util.verifyUtf8(file);
      }
      catch (Exception utfExc) {
        // yes, it seems the problem is the encoding"
        String error = jenaExc.getMessage();
        throw new IOExceptionWithCause(error, utfExc);
      }

      // other kind of problem:
      String error = jenaExc.getClass().getName()+ " : " +jenaExc.getMessage();
      throw new IOExceptionWithCause(error, jenaExc);
   
  }
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

    public void close() throws IOException {
        if (fs != null) {
            try {
                fs.close();
            } catch (FileSystemException e) {
                throw new IOExceptionWithCause(
                        "Unable to close search index file system: " + fs, e);
            }
        }
    }
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

                if (ignoreFailure) {
                    log.warn("Exception while repairing: " + error, e);
                } else if (e instanceof IOException) {
                    throw (IOException) e;
                } else {
                    throw new IOExceptionWithCause(e);
                }
            }
        }
        log.info("Repaired " + (errors.size() - notRepairable) + " errors.");
        if (notRepairable > 0) {
View Full Code Here

Examples of org.apache.commons.io.IOExceptionWithCause

                if (ignoreFailure) {
                    log.warn("Exception while repairing: " + error, e);
                } else if (e instanceof IOException) {
                    throw (IOException) e;
                } else {
                    throw new IOExceptionWithCause(e);
                }
            }
        }
        log.info("Repaired " + (errors.size() - notRepairable) + " errors.");
        if (notRepairable > 0) {
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.