Examples of NestedIOException


Examples of org.springframework.core.NestedIOException

      InputStream is = configLocation.getInputStream();
      try {
        client = configParser.parse(is, properties);
      }
      catch (RuntimeException ex) {
        throw new NestedIOException("Failed to parse config resource: " + configLocation, ex.getCause());
      }
    }

    if (mappingLocations != null) {
      SqlMapParser mapParser = SqlMapParserFactory.createSqlMapParser(configParser);
      for (Resource mappingLocation : mappingLocations) {
        try {
          mapParser.parse(mappingLocation.getInputStream());
        }
        catch (NodeletException ex) {
          throw new NestedIOException("Failed to parse mapping resource: " + mappingLocation, ex);
        }
      }
    }

    return client;
View Full Code Here

Examples of org.springframework.core.NestedIOException

      }
      try {
        return new File((URI) invokeVfsMethod(VFS_UTILS_METHOD_GET_COMPATIBLE_URI, null, vfsResource));
      }
      catch (Exception ex) {
        throw new NestedIOException("Failed to obtain File reference for " + vfsResource, ex);
      }
    }
    else {
      return (File) invokeVfsMethod(GET_PHYSICAL_FILE, vfsResource);
    }
View Full Code Here

Examples of org.springframework.core.NestedIOException

  public URL getURL() throws IOException {
    try {
      return VfsUtils.getURL(this.resource);
    }
    catch (Exception ex) {
      throw new NestedIOException("Failed to obtain URL for file " + this.resource, ex);
    }
  }
View Full Code Here

Examples of org.springframework.core.NestedIOException

  public URI getURI() throws IOException {
    try {
      return VfsUtils.getURI(this.resource);
    }
    catch (Exception ex) {
      throw new NestedIOException("Failed to obtain URI for " + this.resource, ex);
    }
  }
View Full Code Here

Examples of org.springframework.core.NestedIOException

        logger.info("SMB root directory does not exist. Creating it.");
        mkdirs();
      }
      canRead = canRead();
    } catch (SmbException _ex) {
      throw new NestedIOException("Unable to initialize share: " + this, _ex);
    }
    Assert.isTrue(canRead, "Share is not accessible " + this);
    open.set(true);
  }
View Full Code Here

Examples of org.springframework.core.NestedIOException

      SmbFile smbDir = createSmbDirectoryObject(_path);
      if (!smbDir.exists()) {
        logger.warn("Remote directory [" + _path + "] does not exist. Cannot list resources.");
        return files;
      } else if (!smbDir.isDirectory()) {
        throw new NestedIOException("Resource [" + _path + "] is not a directory. Cannot list resources.");
      }

      files = smbDir.listFiles();

    } catch (SmbException _ex) {
      throw new NestedIOException("Failed to list resources in [" + _path + "].", _ex);
    }
    String msg = "Successfully listed " + files.length + " resource(s) in [" + _path + "]";
    if (logger.isDebugEnabled()) {
      logger.debug(msg + ": " + Arrays.toString(files));
    } else {
View Full Code Here

Examples of org.springframework.core.NestedIOException

    try {

      SmbFile remoteFile = createSmbFileObject(_path);
      if (!remoteFile.isFile()) {
        throw new NestedIOException("Resource [" + _path + "] is not a file.");
      }
      FileCopyUtils.copy(remoteFile.getInputStream(), _outputStream);

    } catch (SmbException _ex) {
      throw new NestedIOException("Failed to read resource [" + _path + "].", _ex);
    }
    logger.info("Successfully read resource [" + _path + "].");
  }
View Full Code Here

Examples of org.springframework.core.NestedIOException

        FileCopyUtils.copy(_inputStream, targetFile.getOutputStream());

      }

    } catch (SmbException _ex) {
      throw new NestedIOException("Failed to write resource [" + _path + "].", _ex);
    }
    logger.info("Successfully wrote remote file [" + _path + "].");
  }
View Full Code Here

Examples of org.springframework.core.NestedIOException

      } else {
        logger.info("Remote directory [" + _path + "] exists in share [" + smbShare + "].");
      }
      return true;
    } catch (SmbException _ex) {
      throw new NestedIOException("Failed to create directory [" + _path + "].", _ex);
    }
  }
View Full Code Here

Examples of org.springframework.core.NestedIOException

        smbFileTo.delete();
      }
      smbFileFrom.renameTo(smbFileTo);

    } catch (SmbException _ex) {
      throw new NestedIOException("Failed to rename [" + _pathFrom + "] to [" + _pathTo + "].", _ex);
    }
    logger.info("Successfully renamed remote resource [" + _pathFrom + "] to [" + _pathTo + "].");

  }
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.