Examples of FileEntry


Examples of org.rhq.common.drift.FileEntry

     * @return the new FileEntry, or null if this file is not appropriate for drift detection (typically if the
     * underlying file does not support the needed File operations.
     * @throws IOException if something unexpected occurs, outside of the FileNotFoundException it looks for.
     */
    private FileEntry getAddedFileEntry(File basedir, File file) throws IOException {
        FileEntry result = null;

        try {
            String sha256 = sha256(file);
            String relativePath = relativePath(basedir, file);
            long lastModified = file.lastModified();
View Full Code Here

Examples of org.rhq.common.drift.FileEntry

                    currentSHA = sha256(file);
                    isChanged = !entry.getNewSHA().equals(currentSHA);
                }

                if (isChanged) {
                    FileEntry changedEntry = changedFileEntry(entry.getFile(), entry.getNewSHA(), currentSHA,
                        file.lastModified(), file.length());
                    changedEntries.add(changedEntry);

                    if (null != changedPinnedEntries) {
                        changedPinnedEntries.add(entry);
View Full Code Here

Examples of org.rhq.common.drift.FileEntry

            File deltaChangeSet = new File(currentSnapsotFile.getParentFile(), FILE_CHANGESET_DELTA);
            reader = changeSetMgr.getChangeSetReader(deltaChangeSet);

            int numEntries = 0;
            for (FileEntry entry : reader) {
                FileEntry newEntry = entriesMap.get(entry.getFile());
                if (newEntry == null) {
                    return false;
                }
                if (entry.getType() != newEntry.getType()) {
                    return false;
                }
                switch (entry.getType()) {
                case FILE_ADDED:
                    if (!entry.getNewSHA().equals(newEntry.getNewSHA())) {
                        return false;
                    }
                case FILE_CHANGED:
                    if (!entry.getNewSHA().equals(newEntry.getNewSHA())
                        || !entry.getOldSHA().equals(newEntry.getOldSHA())) {
                        return false;
                    }
                default: // FILE_REMOVED
                    if (!entry.getOldSHA().equals(newEntry.getOldSHA())) {
                        return false;
                    }
                }
                numEntries++;
            }
View Full Code Here

Examples of org.rhq.common.drift.FileEntry

                        if (log.isDebugEnabled()) {
                            log.debug("Adding " + file.getPath() + " to coverage change set for " + schedule);
                        }

                        FileEntry addedFileEntry = getAddedFileEntry(basedir, file);
                        if (null != addedFileEntry) {
                            writer.write(addedFileEntry);
                        }

                    } catch (Throwable t) {
View Full Code Here

Examples of org.rhq.common.drift.FileEntry

                }
            } else {
                Map<String, FileEntry> fileEntries = createSnapshotIndex();

                for (DriftFile driftFile : driftFiles) {
                    FileEntry entry = fileEntries.get(driftFile.getHashId());
                    if (entry == null) {
                        continue;
                    }
                    File file = new File(headers.getBasedir(), entry.getFile());
                    if (file == null || !file.exists()) {
                        log.warn("Unable to find file for " + driftFile);
                    } else {
                        if (log.isDebugEnabled()) {
                            log.debug("Adding " + file.getPath() + " to " + contentFileName);
View Full Code Here

Examples of org.webbitserver.handler.FileEntry

        while ((zipEntry = jarStream.getNextEntry()) != null) {
            if (isChild(subdirectory, zipEntry.getName())) {
                String basename = zipEntry.getName().substring(subdirectory.length());
                int indexOfSlash = basename.indexOf('/');
                if (indexOfSlash < 0 || indexOfSlash == basename.length() - 1) {
                    list.add(new FileEntry(basename));
                }
            }
        }
        return list;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.