Package com.cloudbees.clickstack.util.exception

Examples of com.cloudbees.clickstack.util.exception.RuntimeIOException


        Preconditions.checkArgument(Files.exists(destDir), "Dest %s not found");
        Preconditions.checkArgument(Files.isDirectory(destDir), "Dest %s is not a directory");
        try {
            return Files.copy(srcFile, destDir.resolve(srcFile.getFileName()));
        } catch (IOException e) {
            throw new RuntimeIOException("Exception copying " + srcFile.getFileName() + " to " + srcFile, e);
        }
    }
View Full Code Here


    public static Path copyArtifactToDirectory(@Nonnull Path sourceDir, @Nonnull String artifactId, @Nonnull Path dest) throws RuntimeIOException {
        Path source = findArtifact(sourceDir, artifactId);
        try {
            return Files.copy(source, dest.resolve(source.getFileName()));
        } catch (IOException e) {
            throw new RuntimeIOException("Exception copying " + source.getFileName() + " to " + sourceDir, e);
        }
    }
View Full Code Here

                throw new IllegalStateException("Directory beginning with '" + pattern + "' not found in path: " + srcDir + ", absolutePath: " + srcDir.toAbsolutePath());
            } catch (IllegalArgumentException e) {
                throw new IllegalStateException("More than 1 directory beginning with '" + pattern + "' found in path: " + srcDir + ", absolutePath: " + srcDir.toAbsolutePath() + " -> " + paths);
            }
        } catch (IOException e) {
            throw new RuntimeIOException("Exception finding unique child directory beginning with " + filter + "in " + srcDir);
        }
    }
View Full Code Here

                throw new IllegalStateException("No child directory found in : " + srcDir + ", absolutePath: " + srcDir.toAbsolutePath());
            } catch (IllegalArgumentException e) {
                throw new IllegalStateException("More than 1 child directory found in path: " + srcDir + ", absolutePath: " + srcDir.toAbsolutePath() + " -> " + paths);
            }
        } catch (IOException e) {
            throw new RuntimeIOException("Exception finding unique child directory in " + srcDir);
        }
    }
View Full Code Here

                throw new IllegalStateException("Artifact '" + artifactId + ":" + type + "' not found in path: " + srcDir + ", absolutePath: " + srcDir.toAbsolutePath());
            } catch (IllegalArgumentException e) {
                throw new IllegalStateException("More than 1 version of artifact '" + artifactId + ":" + type + "' found in path: " + srcDir + ", absolutePath: " + srcDir.toAbsolutePath() + " -> " + paths);
            }
        } catch (IOException e) {
            throw new RuntimeIOException("Exception finding artifact " + artifactId + "@" + type + " in " + srcDir);
        }
    }
View Full Code Here

            }
        };
        try {
            Files.walkFileTree(path, setReadOnlyFileVisitor);
        } catch (IOException e) {
            throw new RuntimeIOException("Exception setting permissions file permissions to " + filePermissions + " and folder permissions to " + dirPermissions + " on " + path, e);
        }
    }
View Full Code Here

            }
        };
        try {
            Files.walkFileTree(path, setReadOnlyFileVisitor);
        } catch (IOException e) {
            throw new RuntimeIOException("Exception setting permissions file permissions to " + filePermissions + " and folder permissions to " + dirPermissions + " on " + path, e);
        }
    }
View Full Code Here

            InputStream in = cnn.getInputStream();
            OutputStream out = Files.newOutputStream(destFile);
            long length = ByteStreams.copy(in, out);
            logger.debug("Copied {} in {}: {} bytes", url, destFile, length);
        } catch (IOException e) {
            throw new RuntimeIOException("Exception downloading the content of '" + url + "' to '" + destFile + "'", e);
        }
    }
View Full Code Here

                    }
                }

            });
        } catch (IOException e) {
            throw new RuntimeIOException("Exception deleting '" + dir + "'", e);
        }
    }
View Full Code Here

            }
        };
        try {
            Files.walkFileTree(path, setReadOnlyFileVisitor);
        } catch (IOException e) {
            throw new RuntimeIOException("Exception changing permissions to readonly for " + path, e);
        }
    }
View Full Code Here

TOP

Related Classes of com.cloudbees.clickstack.util.exception.RuntimeIOException

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.