Package org.tmatesoft.svn.core

Examples of org.tmatesoft.svn.core.SVNErrorMessage


        try {
            fsTypeStream = SVNFileUtil.openFileForWriting(dstOwner.getFSTypeFile());
            fsType += '\n';
            fsTypeStream.write(fsType.getBytes("US-ASCII"));
        } catch (IOException ioe) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage());
            SVNErrorManager.error(err, SVNLogType.FSFS);
        } finally {
            SVNFileUtil.closeFile(fsTypeStream);
        }
    }
View Full Code Here


   
    private void createReposDir(File dir) throws SVNException {
        if (dir.exists()) {
            File[] dstChildren = dir.listFiles();
            if (dstChildren.length > 0) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.DIR_NOT_EMPTY,
                        "''{0}'' exists and is non-empty", dir);
                SVNErrorManager.error(err, SVNLogType.FSFS);
            }
        } else {
            dir.mkdirs();
View Full Code Here

    private void createDBLock(File dstPath) throws SVNException {
        try {
            SVNFileUtil.createFile(new File(dstPath, FSFS.DB_LOCK_FILE), FSFS.PRE_12_COMPAT_UNNEEDED_FILE_CONTENTS,
            "US-ASCII");
        } catch (SVNException svne) {
            SVNErrorMessage err = svne.getErrorMessage().wrap("Creating db lock file");
            SVNErrorManager.error(err, SVNLogType.FSFS);
        }
    }
View Full Code Here

    private void createDBLogsLock(File dstPath) throws SVNException {
        try {
            SVNFileUtil.createFile(new File(dstPath, FSFS.DB_LOGS_LOCK_FILE), FSFS.PRE_12_COMPAT_UNNEEDED_FILE_CONTENTS,
            "US-ASCII");
        } catch (SVNException svne) {
            SVNErrorMessage err = svne.getErrorMessage().wrap("Creating db logs lock file");
            SVNErrorManager.error(err, SVNLogType.FSFS);
        }
    }
View Full Code Here

            long packedShard = rev / maxFilesPerDirectory;
            SVNFileUtil.copyDirectory(srcOwner.getPackDir(packedShard), dstOwner.getPackDir(packedShard), false, null);
        }
       
        if (rev != minUnpackedRevision) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN,
                    "Assertion failed: expected minimal unpacked revision {0}, but real revision is {1}",
                    new Object[] { String.valueOf(minUnpackedRevision), String.valueOf(rev) });
            SVNErrorManager.error(err, SVNLogType.FSFS);
        }
           
View Full Code Here

        myOffset = 0;
        myLength = representation.getExpandedSize();
        try {
            myDigest = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException nsae) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, "MD5 implementation not found: {0}", nsae.getLocalizedMessage());
            SVNErrorManager.error(err, nsae, SVNLogType.FSFS);
        }

        try {
            buildRepresentationList(representation, myRepStateList, owner);
View Full Code Here

    public static InputStream createDeltaStream(SVNDeltaCombiner combiner, FSRevisionNode fileNode, FSFS owner) throws SVNException {
        if (fileNode == null) {
            return SVNFileUtil.DUMMY_IN;
        } else if (fileNode.getType() != SVNNodeKind.FILE) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_FILE, "Attempted to get textual contents of a *non*-file node");
            SVNErrorManager.error(err, SVNLogType.FSFS);
        }
        FSRepresentation representation = fileNode.getTextRepresentation();
        if (representation == null) {
            return SVNFileUtil.DUMMY_IN;
View Full Code Here

            if (myOffset == myLength) {
                isChecksumFinalized = true;
                String hexDigest = SVNFileUtil.toHexDigest(myDigest);

                if (!myHexChecksum.equals(hexDigest)) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Checksum mismatch while reading representation:\n   expected:  {0}\n     actual:  {1}", new Object[] {
                            myHexChecksum, hexDigest
                    });
                    SVNErrorManager.error(err, SVNLogType.FSFS);
                }
            }
View Full Code Here

                    while (curState.myChunkIndex < myChunkIndex) {
                        myCombiner.skipWindow(curState.myFile);
                        curState.myChunkIndex++;
                        curState.myOffset = curState.myFile.position();
                        if (curState.myOffset >= curState.myEnd) {
                            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Reading one svndiff window read beyond the end of the representation");
                            SVNErrorManager.error(err, SVNLogType.FSFS);
                        }
                    }
                    SVNDiffWindow window = myCombiner.readWindow(curState.myFile, curState.myVersion);
                    ByteBuffer target = myCombiner.addWindow(window);
View Full Code Here

                buffer.clear();
                int r = file.read(buffer);

                byte[] header = buffer.array();
                if (!(header[0] == 'S' && header[1] == 'V' && header[2] == 'N' && r == 4)) {
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_CORRUPT, "Malformed svndiff data in representation");
                    SVNErrorManager.error(err, SVNLogType.FSFS);
                }
                repState.myVersion = header[3];
                repState.myChunkIndex = 0;
                repState.myOffset += 4;
                /*
                 * Push this rep onto the list. If it's self-compressed, we're
                 * done.
                 */
                result.addLast(repState);
                if (repState.myIsDeltaVsEmpty) {
                    return null;
                }
                rep.setRevision(repState.myBaseRevision);
                rep.setOffset(repState.myBaseOffset);
                rep.setSize(repState.myBaseLength);
                rep.setTxnId(null);
            }
        } catch (IOException ioe) {
            file.close();
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, ioe.getLocalizedMessage());
            SVNErrorManager.error(err, ioe, SVNLogType.FSFS);
        } catch (SVNException svne) {
            file.close();
            throw svne;
        }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.SVNErrorMessage

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.