Package org.apache.commons.io

Examples of org.apache.commons.io.IOExceptionWithCause


                                    }
                                } catch (Exception e) {
                                    String msg = "Error while storing blob. id="
                                            + state.getId() + " idx=" + i + " size=" + size;
                                    log.error(msg, e);
                                    throw new IOExceptionWithCause(msg, e);
                                }
                                try {
                                    // replace value instance with value
                                    // backed by resource in blob store and delete temp file
                                    if (blobStore instanceof ResourceBasedBLOBStore) {
                                        values[i] = InternalValue.create(((ResourceBasedBLOBStore) blobStore).getResource(blobId));
                                    } else {
                                        values[i] = InternalValue.create(blobStore.get(blobId));
                                    }
                                } catch (Exception e) {
                                    log.error("Error while reloading blob. truncating. id="
                                            + state.getId() + " idx=" + i + " size=" + size, e);
                                    values[i] = InternalValue.create(new byte[0]);
                                }
                                val.discard();
                            }
                            // store id of blob as property value
                            writeString(blobId);   // value
                        } else {
                            // delete evt. blob
                            byte[] data = writeSmallBinary(val, state, i);
                            // replace value instance with value
                            // backed by resource in blob store and delete temp file
                            values[i] = InternalValue.create(data);
                            val.discard();
                        }
                    } catch (RepositoryException e) {
                        String msg = "Error while storing blob. id="
                            + state.getId() + " idx=" + i + " value=" + val;
                        log.error(msg, e);
                        throw new IOExceptionWithCause(msg, e);
                    }
                    break;
                case PropertyType.DOUBLE:
                    try {
                        out.writeDouble(val.getDouble());
View Full Code Here


   
    private static IOException convertToIOException(int propertyType, Exception e) {
        String typeName = PropertyType.nameFromValue(propertyType);
        String message = "Unexpected error for property type "+ typeName +" value.";
        log.error(message, e);
        return new IOExceptionWithCause(message, e);
    }
View Full Code Here

            return data;
        } catch (Exception e) {
            String msg = "Error while storing blob. id="
                    + state.getId() + " idx=" + i + " value=" + value;
            log.error(msg, e);
            throw new IOExceptionWithCause(msg, e);
        }
    }
View Full Code Here

    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

                                val = InternalValue.create(new byte[0]);
                            } else {
                                throw e;
                            }
                        } catch (Exception e) {
                            throw new IOExceptionWithCause("Unable to create property value: " + e.toString(), e);
                        }
                    } else {
                        // short values into memory
                        byte[] data = new byte[size];
                        in.readFully(data);
View Full Code Here

    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

        createDefaultProject(project);
        return LOAD_RETURN_TYPE.NEW_PROJECT;
      }
    }
    catch (Exception e) {
      throw new IOExceptionWithCause(e);
    }
  }
View Full Code Here

      urlFile = urlFile.startsWith("/") ? urlFile.substring(1): urlFile;
      String projectUrl = project.getProjectHome().toURL().toExternalForm();
      projectUrl = projectUrl.endsWith("/") ? projectUrl.substring(0, projectUrl.length()-1): projectUrl;
      absolutePath = new URL(projectUrl+"/"+urlFile);
    } catch (Exception e) {
      throw new IOExceptionWithCause(e);
    }
    return absolutePath;
  }
View Full Code Here

          throws IOExceptionWithCause {
        if(waitFor) {
          try {
            proc.waitFor();
          } catch (InterruptedException e) {
            throw new IOExceptionWithCause(e);
          }
        }
      }
    };
  }
View Full Code Here

        int res = 0;
        try {
            res = Integer.parseInt(ar[0]);
        } catch (NumberFormatException ex) {
            log.error("Error reading chunk size near: " + sLine, ex);
            throw new IOExceptionWithCause(ex);
        }
        return res;
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.io.IOExceptionWithCause

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.