Package com.xebialabs.overthere

Examples of com.xebialabs.overthere.RuntimeIOException


     * @param dirDescription to prepend to error message.
     * @throws RuntimeIOException if file is not a directory.
     */
    private static void checkReallyIsADirectory(OverthereFile dir, String dirDescription) {
        if (dir.exists() && !dir.isDirectory()) {
            throw new RuntimeIOException(dirDescription + " directory " + dir + " exists but is not a directory");
        }
    }
View Full Code Here


        CmdLine cmdLine = new CmdLine().addTemplatedFragment(copyCommandTemplate, source.getPath(), getPath());

        CapturingOverthereExecutionOutputHandler capturedStderr = capturingHandler();
        int errno = source.getConnection().execute(loggingOutputHandler(logger), multiHandler(loggingErrorHandler(logger), capturedStderr), cmdLine);
        if (errno != 0) {
            throw new RuntimeIOException(format("Cannot copy [%s] to [%s] on [%s]: %s (errno=%d)", source.getPath(), getPath(), getConnection(), capturedStderr.getOutput(), errno));
        }
    }
View Full Code Here

            }
            temporaryFileHolderDirectoryNameSuffix++;
        }

        if(originalExc != null) {
            throw new RuntimeIOException("Cannot generate a unique temporary file name on " + this, originalExc);
        } else {
            throw new RuntimeIOException("Cannot generate a unique temporary file name on " + this);
        }
    }
View Full Code Here

                Thread.currentThread().interrupt();

                logger.info("Execution interrupted, destroying the process.");
                process.destroy();

                throw new RuntimeIOException("Execution interrupted", exc);
            }
        } finally {
            quietlyJoinThread(stdoutReaderThread);
            quietlyJoinThread(stderrReaderThread);
        }
View Full Code Here

            }
            handleStart(startDirectory);
            walk(startDirectory, 0);
            handleEnd();
        } catch (IOException e) {
            throw new RuntimeIOException(e);
        }

    }
View Full Code Here

     */
    public static void write(final String from, final String charsetName, final OverthereFile to) {
        try {
            write(from.getBytes(charsetName), to);
        } catch (UnsupportedEncodingException exc) {
            throw new RuntimeIOException("Cannot write string to " + to, exc);
        }
    }
View Full Code Here

                        }
                        if (outputReaderThreadException[0] != null) {
                            if (outputReaderThreadException[0] instanceof RuntimeException) {
                                throw (RuntimeException) outputReaderThreadException[0];
                            } else {
                                throw new RuntimeIOException(format("Cannot execute command [%s] on [%s]", obfuscatedCmd, CifsWinRmConnection.this), outputReaderThreadException[0]);
                            }
                        }
                        return exitValue();
                    } catch (InterruptedException exc) {
                        throw new RuntimeIOException(format("Cannot execute command [%s] on [%s]", obfuscatedCmd, CifsWinRmConnection.this), exc);
                    }
                }

                @Override
                public synchronized void destroy() {
                    if (processTerminated) {
                        return;
                    }

                    winRmClient.signal();
                    winRmClient.deleteShell();
                    closeQuietly(callersStdin);
                    processTerminated = true;
                }

                @Override
                public synchronized int exitValue() {
                    if (!processTerminated) {
                        throw new IllegalThreadStateException(format("Process for command [%s] on [%s] is still running", obfuscatedCmd,
                                CifsWinRmConnection.this));
                    }

                    return winRmClient.exitValue();
                }
            };

        } catch (IOException exc) {
            throw new RuntimeIOException("Cannot execute command " + cmd + " on " + this, exc);
        }
    }
View Full Code Here

        logger.debug("Checking {} for existence", this);

        try {
            return connection.getSharedSftpClient().statExistence(getSftpPath()) != null;
        } catch (IOException e) {
            throw new RuntimeIOException(format("Cannot check existence of file %s", this), e);
        }
    }
View Full Code Here

        logger.debug("Statting {}", this);

        try {
            return connection.getSharedSftpClient().stat(getSftpPath());
        } catch (IOException e) {
            throw new RuntimeIOException(format("Cannot stat %s", this), e);
        }
    }
View Full Code Here

                files.add(getFile(filename));
            }

            return files;
        } catch (IOException e) {
            throw new RuntimeIOException(format("Cannot list directory %s", this), e);
        }
    }
View Full Code Here

TOP

Related Classes of com.xebialabs.overthere.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.