private static void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private static void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private InputStream getDelegate() throws IOException { if (myDelegate == null) { try { myDelegate = SVNFileUtil.openFileForReading(myFile, SVNLogType.NETWORK); } catch (SVNException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e.getMessage()); } } return myDelegate; }
private InputStream getDelegate() throws IOException { if (myDelegate == null) { try { myDelegate = SVNFileUtil.openFileForReading(myFile, SVNLogType.NETWORK); } catch (SVNException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e.getMessage()); } } return myDelegate; }
private InputStream getDelegate() throws IOException { if (myDelegate == null) { try { myDelegate = SVNFileUtil.openFileForReading(myFile, SVNLogType.NETWORK); } catch (SVNException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e.getMessage()); } } return myDelegate; }
private static void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private void handleLeftLocalModificationsError(SVNException originalError) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { return; } throw originalError; }
private void openNextFile() throws IOException { myCurrentFile = (File) myFiles.removeFirst(); SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "READING SPOOLED FILE: " + myCurrentFile); myCurrentSize = myCurrentFile.length(); SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "ABOUT TO READ: " + myCurrentSize); try { myCurrentInput = SVNFileUtil.openFileForReading(myCurrentFile, SVNLogType.NETWORK); } catch (SVNException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e.getMessage()); } }
private void openNextFile() throws IOException { myCurrentFile = (File) myFiles.removeFirst(); SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "READING SPOOLED FILE: " + myCurrentFile); myCurrentSize = myCurrentFile.length(); SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "ABOUT TO READ: " + myCurrentSize); try { myCurrentInput = SVNFileUtil.openFileForReading(myCurrentFile, SVNLogType.NETWORK); } catch (SVNException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e.getMessage()); } }
private void openNextFile() throws IOException { myCurrentFile = (File) myFiles.removeFirst(); SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "READING SPOOLED FILE: " + myCurrentFile); myCurrentSize = myCurrentFile.length(); SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "ABOUT TO READ: " + myCurrentSize); try { myCurrentInput = SVNFileUtil.openFileForReading(myCurrentFile, SVNLogType.NETWORK); } catch (SVNException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e.getMessage()); } }
public void write(byte[] b, int off, int len) throws IOException { if (myCurrentOutput == null) { // open first file. File file = createNextFile(); SVNDebugLog.getDefaultLog().logFine(SVNLogType.NETWORK, "SPOOLING RESPONSE TO FILE: " + file); myFiles.add(file); try { myCurrentOutput = SVNFileUtil.openFileForWriting(file); } catch (SVNException e) { if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e.getMessage()); } } myCurrentOutput.write(b, off, len); myCurrentSize += len; if (myCurrentSize >= LIMIT) { close(); } }
private void handleLeftLocalModificationsError(SVNException originalError, SVNLog log, SVNAdminArea adminArea) throws SVNException { SVNException error = null; for (error = originalError; error != null;) { if (error.getErrorMessage().getErrorCode() == SVNErrorCode.WC_LEFT_LOCAL_MOD) { break; } error = (error.getCause() instanceof SVNException) ? (SVNException) error.getCause() : null; } if (error != null) { log.delete(); SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_OBSTRUCTED_UPDATE, "Won''t delete locally modified directory ''{0}''", adminArea.getRoot()); SVNErrorManager.error(err, error); } throw originalError; }
/** * Creates an exception given an error message and the cause exception. * * @param errorMessage an error message * @param cause the real cause of the error */ public SVNException(SVNErrorMessage errorMessage, Throwable cause) { super(cause != null ? cause : errorMessage.getCause()); if (cause == null) { cause = errorMessage.getCause(); } if (cause instanceof SVNException) { SVNErrorMessage childMessages = ((SVNException) cause).getErrorMessage(); SVNErrorMessage parent = errorMessage; while(parent.hasChildErrorMessage()) { parent = parent.getChildErrorMessage(); } if (parent != childMessages) { parent.setChildErrorMessage(childMessages); } } myErrorMessage = errorMessage; if (getCause() == null && errorMessage != null) { errorMessage.initCause(this); } }
private static void handleInconsistentEOL(SVNException svne, Object path) throws SVNException { SVNErrorMessage errorMessage = svne.getErrorMessage(); while (errorMessage != null && errorMessage.getErrorCode() != SVNErrorCode.IO_INCONSISTENT_EOL) { errorMessage = errorMessage.getChildErrorMessage(); } if (errorMessage != null && errorMessage.getErrorCode() == SVNErrorCode.IO_INCONSISTENT_EOL) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "File ''{0}'' has inconsistent newlines", path); SVNErrorManager.error(error, SVNLogType.DEFAULT); } Throwable cause = svne.getCause(); if (cause == null) { return; } if (cause instanceof SVNException) { handleInconsistentEOL((SVNException) cause, path); } else if (cause instanceof IOExceptionWrapper) { IOExceptionWrapper wrapper = (IOExceptionWrapper) cause; handleInconsistentEOL(wrapper.getOriginalException(), path); } } }
private static void handleInconsistentEOL(SVNException svne, Object path) throws SVNException { SVNErrorMessage errorMessage = svne.getErrorMessage(); while (errorMessage != null && errorMessage.getErrorCode() != SVNErrorCode.IO_INCONSISTENT_EOL) { errorMessage = errorMessage.getChildErrorMessage(); } if (errorMessage != null && errorMessage.getErrorCode() == SVNErrorCode.IO_INCONSISTENT_EOL) { SVNErrorMessage error = SVNErrorMessage.create(SVNErrorCode.ILLEGAL_TARGET, "File ''{0}'' has inconsistent newlines", path); SVNErrorManager.error(error, SVNLogType.DEFAULT); } Throwable cause = svne.getCause(); if (cause == null) { return; } if (cause instanceof SVNException) { handleInconsistentEOL((SVNException) cause, path); } else if (cause instanceof IOExceptionWrapper) { IOExceptionWrapper wrapper = (IOExceptionWrapper) cause; handleInconsistentEOL(wrapper.getOriginalException(), path); } } }