Package sortpom.exception

Examples of sortpom.exception.FailureException


        backupFile = new File(newName);
    }

    private void checkBackupFileAccess() {
        if (backupFile.exists() && !backupFile.delete()) {
            throw new FailureException("Could not remove old backup file, filename: " + newName);
        }
    }
View Full Code Here


        try {
            source = new FileInputStream(pomFile);
            newFile = new FileOutputStream(backupFile);
            IOUtils.copy(source, newFile);
        } catch (IOException e) {
            throw new FailureException("Could not create backup file to filename: " + newName, e);
        } finally {
            IOUtils.closeQuietly(newFile);
            IOUtils.closeQuietly(source);
        }
    }
View Full Code Here

        InputStream inputStream = null;
        try {
            inputStream = new FileInputStream(pomFile);
            return IOUtils.toString(inputStream, encoding);
        } catch (UnsupportedEncodingException ex) {
            throw new FailureException("Could not handle encoding: " + encoding, ex);
        } catch (IOException ex) {
            throw new FailureException("Could not read pom file: " + pomFile.getAbsolutePath(), ex);
        } finally {
            IOUtils.closeQuietly(inputStream);
        }
    }
View Full Code Here

        FileOutputStream saveFile = null;
        try {
            saveFile = new FileOutputStream(pomFile);
            IOUtils.write(sortedXml, saveFile, encoding);
        } catch (IOException e) {
            throw new FailureException("Could not save sorted pom file: " + pomFile.getAbsolutePath(), e);
        } finally {
            IOUtils.closeQuietly(saveFile);
        }
    }
View Full Code Here

    public void scanForIgnoredSections(String originalXml) {
        this.originalXml = originalXml;
        SortpomPiScanner sortpomPiScanner = new SortpomPiScanner(logger);
        sortpomPiScanner.scan(originalXml);
        if (sortpomPiScanner.isScanError()) {
            throw new FailureException(sortpomPiScanner.getFirstError());
        }
        containsIgnoredSections = sortpomPiScanner.containsIgnoredSections();
    }
View Full Code Here

    private void initializeSortOrderMap() {
        try {
            Document document = createDocumentFromDefaultSortOrderFile();
            addElementsToSortOrderMap(document.getRootElement(), SORT_ORDER_BASE);
        } catch (IOException e) {
            throw new FailureException(e.getMessage(), e);
        } catch (JDOMException e) {
            throw new FailureException(e.getMessage(), e);
        }
    }
View Full Code Here

TOP

Related Classes of sortpom.exception.FailureException

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.