Package com.starbase.starteam

Examples of com.starbase.starteam.File


            // For all Files in this folder, we need to check
            // if there have been modifications.

            for (int i = 0; i < files.length; i++) {
                File eachFile = (File) files[i];
                String filename = eachFile.getName();
                java.io.File localFile =
                        new java.io.File(targetFolder, filename);

                ufm.removeControlledItem(localFile);
View Full Code Here


            // For all Files in this folder, we need to check
            // if there have been modifications.

            Item[] files = starteamFolder.getItems("File");
            for (int i = 0; i < files.length; i++) {
                File eachFile = (File) files[i];
                String filename = eachFile.getName();
                java.io.File localFile =
                        new java.io.File(targetFolder, filename);

                delistLocalFile(localFiles, localFile);

                // If the file doesn't pass the include/exclude tests, skip it.
                if (!shouldProcess(filename)) {
                    log("Skipping " + eachFile.toString(), Project.MSG_INFO);
                    continue;
                }


                // If forced is not set then we may save ourselves some work by
                // looking at the status flag.
                // Otherwise, we care nothing about these statuses.

                if (!isForced()) {
                    int fileStatus = (eachFile.getStatus());

                    // We try to update the status once to give StarTeam
                    // another chance.
                    if (fileStatus == Status.MERGE || fileStatus == Status.UNKNOWN) {
                        eachFile.updateStatus(true, true);
                        fileStatus = (eachFile.getStatus());
                    }
                    if (fileStatus == Status.CURRENT) {
                        log("Not processing " + eachFile.toString()
                                + " as it is current.",
                                Project.MSG_INFO);
                        continue;
                    }
                }


                // Check out anything else.
                // Just a note: StarTeam has a status for NEW which implies
                // that there is an item  on your local machine that is not
                // in the repository.  These are the items that show up as
                // NOT IN VIEW in the Starteam GUI.
                // One would think that we would want to perhaps checkin the
                // NEW items (not in all cases! - Steve Cohen 15 Dec 2001)
                // Unfortunately, the sdk doesn't really work, and we can't
                // actually see  anything with a status of NEW. That is why
                // we can just check out  everything here without worrying
                // about losing anything.

                log("Checking Out: " + (localFile.toString()), Project.MSG_INFO);
                eachFile.checkoutTo(localFile, this.lockStatus,
                        true, true, true);
            }

            // Now we recursively call this method on all sub folders in this
            // folder unless recursive attribute is off.
View Full Code Here

            // For all Files in this folder, we need to check
            // if there have been modifications.

            Item[] files = starteamFolder.getItems("File");
            for (int i = 0; i < files.length; i++) {
                File eachFile = (File) files[i];
                String filename = eachFile.getName();
                java.io.File localFile =
                        new java.io.File(targetFolder, filename);

                delistLocalFile(localFiles, localFile);

                // If the file doesn't pass the include/exclude tests, skip it.
                if (!shouldProcess(filename)) {
                    log("Skipping " + eachFile.toString(), Project.MSG_INFO);
                    continue;
                }


                // If forced is not set then we may save ourselves some work by
                // looking at the status flag.
                // Otherwise, we care nothing about these statuses.

                if (!isForced()) {
                    int fileStatus = (eachFile.getStatus());

                    // We try to update the status once to give StarTeam
                    // another chance.
                    if (fileStatus == Status.MERGE
                            || fileStatus == Status.UNKNOWN) {
                        eachFile.updateStatus(true, true);
                        fileStatus = (eachFile.getStatus());
                    }
                    if (fileStatus == Status.CURRENT) {
                        log("Not processing " + eachFile.toString()
                                + " as it is current.",
                                Project.MSG_INFO);
                        continue;
                    }
                }

                // Check in anything else.

                log("Checking In: " + (localFile.toString()), Project.MSG_INFO);
                eachFile.checkinFrom(localFile, this.comment,
                        this.lockStatus,
                        true, true, true);
            }

            // Now we recursively call this method on all sub folders in this
View Full Code Here

                visit(newFolder, file);
            }
        } else {
            log("Adding new file to repository: " + file.getAbsolutePath(),
                    Project.MSG_INFO);
            File newFile = new File(parentFolder);
            newFile.addFromStream(new FileInputStream(file),
                    file.getName(),
                    null, this.comment, 3, true);
        }
    }
View Full Code Here

            // For all Files in this folder, we need to check
            // if there have been modifications.

            Item[] files = starteamFolder.getItems("File");
            for (int i = 0; i < files.length; i++) {
                File eachFile = (File) files[i];
                String filename = eachFile.getName();
                java.io.File localFile =
                        new java.io.File(targetFolder, filename);

                delistLocalFile(localFiles, localFile);
View Full Code Here

            // For all Files in this folder, we need to check
            // if there have been modifications.

            for (int i = 0; i < files.length; i++) {
                File eachFile = (File) files[i];
                String filename = eachFile.getName();
                java.io.File localFile =
                        new java.io.File(targetFolder, filename);

                ufm.removeControlledItem(localFile);
View Full Code Here

     * Compare old and new file lists to determine what happened
     */
    private void compareFileLists(Map nowFiles, Map lastBuildFiles) {
        for (Iterator iter = nowFiles.keySet().iterator(); iter.hasNext();) {
            Integer currentItemID = (Integer) iter.next();
            File currentFile = (File) nowFiles.get(currentItemID);

            if (lastBuildFiles.containsKey(currentItemID)) {
                File lastBuildFile = (File) lastBuildFiles.get(currentItemID);

                if (fileHasBeenModified(currentFile, lastBuildFile)) {
                    addRevision(currentFile, "modified");
                } else if (fileHasBeenMoved(currentFile, lastBuildFile)) {
                    addRevision(currentFile, "moved");
View Full Code Here

     * Now examine old files.  They have to have been deleted as we know they
     * are not in the new list from the processing above.
     */
    private void examineOldFiles(Map lastBuildFiles) {
        for (Iterator iter = lastBuildFiles.values().iterator(); iter.hasNext();) {
            File currentLastBuildFile = (File) iter.next();
            addRevision((File) currentLastBuildFile.getFromHistoryByDate(nowDate), "deleted");
        }
    }
View Full Code Here

        //    Thread.sleep(100);
        //} catch (InterruptedException ignoredInterruptedException) {}

        Item[] files = folder.getItems("File");
        for (int i = 0; i < files.length; i++) {
            File file = (File) files[i];
            fileList.put(new Integer(file.getItemID()), file);
        }

        Folder[] folders = folder.getSubFolders();
        for (int i = 0; i < folders.length; i++) {
            addFolderModsToList(fileList, folders[i]);
View Full Code Here

     * Compare old and new file lists to determine what happened
     */
    private void compareFileLists(Map nowFiles, Map lastBuildFiles) {
        for (Iterator iter = nowFiles.keySet().iterator(); iter.hasNext();) {
            Integer currentItemID = (Integer) iter.next();
            File currentFile = (File) nowFiles.get(currentItemID);

            if (lastBuildFiles.containsKey(currentItemID)) {
                File lastBuildFile = (File) lastBuildFiles.get(currentItemID);

                if (fileHasBeenModified(currentFile, lastBuildFile)) {
                    addRevision(currentFile, "modified");
                } else if (fileHasBeenMoved(currentFile, lastBuildFile)) {
                    addRevision(currentFile, "moved");
View Full Code Here

TOP

Related Classes of com.starbase.starteam.File

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.