Package org.exist.util.io

Examples of org.exist.util.io.Resource


        }
        return tmpFile;
    }

    public static File getSystemConfigurationDirectory() {
        return new Resource("/system/etc/subversion");
    }
View Full Code Here


        myChangelistName = changelistName;
        myTreeConflict = treeConflict;
       
        if (file != null) {
            if (conflictOld != null) {
                myConflictOldFile = new Resource(file.getParentFile(), conflictOld);
            }
            if (conflictNew != null) {
                myConflictNewFile = new Resource(file.getParentFile(), conflictNew);
            }
            if (conflictWorking != null) {
                myConflictWrkFile = new Resource(file.getParentFile(),
                        conflictWorking);
            }
            if (propRejectFile != null) {
                myPropConflictFile = new Resource(file.getParentFile(),
                        propRejectFile);
            }
        }

        myIsRemote = false;
View Full Code Here

        // create root if missing or delete (if force).
        addDir("", null, -1);
    }

    public void addDir(String path, String copyFromPath, long copyFromRevision) throws SVNException {
        myCurrentDirectory = new Resource(myRoot, path);
        myCurrentPath = path;

        SVNFileType dirType = SVNFileType.getType(myCurrentDirectory);
        if (dirType == SVNFileType.FILE || dirType == SVNFileType.SYMLINK) {
            // export is obstructed.
View Full Code Here

        myCurrentPath = SVNPathUtil.removeTail(myCurrentPath);
    }

    public void addFile(String path, String copyFromPath, long copyFromRevision)
            throws SVNException {
        File file = new Resource(myRoot, path);

        if (!myIsForce && file.exists()) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_OBSTRUCTED_UPDATE, "File ''{0}'' already exists", file);
            SVNErrorManager.error(err, SVNLogType.WC);
        }
        myCurrentFile = file;
        myFileProperties = new SVNProperties();
View Full Code Here

   
    private static void checkWCNG(File path, File targetPath) throws SVNException {
        if (path == null) {
            return;
        }
        File dbFile = new Resource(path, ".svn/wc.db");
        SVNFileType type = SVNFileType.getType(dbFile);
        if (type == SVNFileType.FILE) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_UNSUPPORTED_FORMAT,
                    "The path ''{0}'' appears to be part of Subversion 1.7 (SVNKit 1.4) or greater\n" +
                    "working copy rooted at ''{1}''.\n" +
View Full Code Here

   
    public static SVNAdminArea open(File path, Level logLevel) throws SVNException {
        SVNErrorMessage error = null;
        int wcFormatVersion = -1;
        Collection enabledFactories = getSelector().getEnabledFactories(path, ourFactories, false);
        File adminDir = new Resource(path, SVNFileUtil.getAdminDirectoryName());
        File entriesFile = new Resource(adminDir, "entries");
        if (adminDir.isDirectory() && entriesFile.isFile()) {
            for (Iterator factories = enabledFactories.iterator(); factories.hasNext();) {
                SVNAdminAreaFactory factory = (SVNAdminAreaFactory) factories.next();
                try {
                    wcFormatVersion = factory.getVersion(path);
                    if (wcFormatVersion > factory.getSupportedVersion()) {                       
View Full Code Here

    public static void createVersionedDirectory(File path, SVNURL url, SVNURL rootURL, String uuid, long revNumber, SVNDepth depth) throws SVNException {
        createVersionedDirectory(path, url != null ? url.toString() : null, rootURL != null ? rootURL.toString() : null, uuid, revNumber, depth);
    }
       
    private static boolean checkAdminAreaExists(File dir, String url, long revision) throws SVNException {
        File adminDir = new Resource(dir, SVNFileUtil.getAdminDirectoryName());
        if (adminDir.exists() && !adminDir.isDirectory()) {
            SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.WC_OBSTRUCTED_UPDATE, "''{0}'' is not a directory", dir);
            SVNErrorManager.error(err, SVNLogType.WC);
        } else if (!adminDir.exists()) {
            return false;
        }
       
        boolean wcExists = false;
        try {
View Full Code Here

    private File myLockFile;
    private File myEntriesFile;

    public SVNXMLAdminArea(File dir) {
        super(dir);
        myLockFile = new Resource(getAdminDirectory(), "lock");
        myEntriesFile = new Resource(getAdminDirectory(), "entries");
    }
View Full Code Here

            if (reposURL != null && !SVNPathUtil.isAncestor(reposURL, url)) {
                SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNKNOWN, "Entry ''{0}'' has inconsistent repository root and url", getThisDirName());
                SVNErrorManager.error(err, SVNLogType.WC);
            }
   
            Resource tmpFile = new Resource(getAdminDirectory(), "tmp/entries");
            Writer os = null;
            try {
//                os = new OutputStreamWriter(SVNFileUtil.openFileForWriting(tmpFile), "UTF-8");
              os = SVNFileUtil.openFileForWriting(tmpFile);
                writeEntries(os);
View Full Code Here

    }
   
    public SVNAdminArea createVersionedDirectory(File dir, String url, String rootURL, String uuid, long revNumber, boolean createMyself, SVNDepth depth) throws SVNException {
        dir = createMyself ? getRoot() : dir;
        dir.mkdirs();
        File adminDir = createMyself ? getAdminDirectory() : new Resource(dir, SVNFileUtil.getAdminDirectoryName());
        adminDir.mkdir();
        SVNFileUtil.setHidden(adminDir, true);
        // lock dir.
        File lockFile = createMyself ? myLockFile : new Resource(adminDir, "lock");
        SVNFileUtil.createEmptyFile(lockFile);
        SVNAdminUtil.createReadmeFile(adminDir);
        SVNFileUtil.createEmptyFile(createMyself ? getAdminFile("empty-file") : new Resource(adminDir, "empty-file"));
        File[] tmp = {
                createMyself ? getAdminFile("tmp") : new Resource(adminDir, "tmp"),
                createMyself ? getAdminFile("tmp" + Resource.separatorChar + "props") : new Resource(adminDir, "tmp" + Resource.separatorChar + "props"),
                createMyself ? getAdminFile("tmp" + Resource.separatorChar + "prop-base") : new Resource(adminDir, "tmp" + Resource.separatorChar + "prop-base"),
                createMyself ? getAdminFile("tmp" + Resource.separatorChar + "text-base") : new Resource(adminDir, "tmp" + Resource.separatorChar + "text-base"),
                createMyself ? getAdminFile("tmp" + Resource.separatorChar + "wcprops") : new Resource(adminDir, "tmp" + Resource.separatorChar + "wcprops"),
                createMyself ? getAdminFile("props") : new Resource(adminDir, "props"),
                createMyself ? getAdminFile("prop-base") : new Resource(adminDir, "prop-base"),
                createMyself ? getAdminFile("text-base") : new Resource(adminDir, "text-base"),
                createMyself ? getAdminFile("wcprops") : new Resource(adminDir, "wcprops")};
        for (int i = 0; i < tmp.length; i++) {
            tmp[i].mkdir();
        }
        SVNAdminUtil.createFormatFile(adminDir);
View Full Code Here

TOP

Related Classes of org.exist.util.io.Resource

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.