/** * Compare the two files using the {@link File#compareTo(File)} method. * * @param file1 The first file to compare * @param file2 The second file to compare * @return the result of calling file1's * {@link File#compareTo(File)} with file2 as the parameter. */ @Override public int compare(final File file1, final File file2) { return file1.compareTo(file2); } }
@Override public Comparator<File> getComparator() { return (a, b) -> a.compareTo(b); } },
@Override public int compareTo(Printer printer) { return this.inputFile.compareTo(printer.inputFile); }
private boolean isBaseDirectory(File directory) { return directory.compareTo(baseDirectory) == 0; }
@Override public int compare(File o1, File o2) { try { return Ints.compare(Integer.parseInt(o1.getName()), Integer.parseInt(o2.getName())); } catch (NumberFormatException e) { log.error(e, "Couldn't compare as numbers? [%s][%s]", o1, o2); return o1.compareTo(o2); } } }
public int compareTo(GeneratedImage this2) { final int cmp = this.pngFile.compareTo(this2.getPngFile()); if (cmp != 0) { return cmp; } return this.description.compareTo(this2.getDescription()); }
File mpp = new File(project.getBasedir(), m); mpp = mpp.getCanonicalFile(); if (mpp.compareTo(mod.getBasedir()) == 0 && descendants.add(mod) && getLog().isDebugEnabled()) { getLog().debug(String.format("Descendant module %s added", mod.getName())); File mpp = new File(dec.getBasedir(), mod); mpp = mpp.getCanonicalFile(); if (mpp.compareTo(p.getBasedir()) == 0) { addedDescendants.add(p);
+ " does not exist."); if(!(newVersionDir.getParentFile().compareTo(storeDir.getAbsoluteFile()) == 0 && ReadOnlyUtils.checkVersionDirName(newVersionDir))) throw new VoldemortException("Invalid version folder name '" + newVersionDir
@Override public int compareTo(ModifiedFile another) { if (getModified() < another.getModified()) { return -1; } else if (getModified() > another.getModified()) { return 1; } else { return getFile().compareTo(another.getFile()); } }
@Signature(@Arg("file")) public Memory compareTo(Environment env, Memory... args){ File what; if (args[0].isObject()){ if (args[0].instanceOf("php\\io\\File")){ FileObject fileObject = (FileObject)args[0].toValue(ObjectMemory.class).value; what = fileObject.file; } else { exception(env, "Argument 1 must be an instance of %s", "php\\io\\File"); return Memory.FALSE; } } else { what = new File(args[0].toString()); } return LongMemory.valueOf(file.compareTo(what)); }
/** * Compare this FileResource to another Resource. * @param another the other Resource against which to compare. * @return a negative integer, zero, or a positive integer as this FileResource * is less than, equal to, or greater than the specified Resource. */ @Override public int compareTo(Resource another) { if (isReference()) { return getCheckedRef().compareTo(another); } if (this.equals(another)) { return 0; } FileProvider otherFP = another.as(FileProvider.class); if (otherFP != null) { File f = getFile(); if (f == null) { return -1; } File of = otherFP.getFile(); if (of == null) { return 1; } int compareFiles = f.compareTo(of); return compareFiles != 0 ? compareFiles : getName().compareTo(another.getName()); } return super.compareTo(another); }
/** * Verify whether the actual directory location of block file has the * expected directory path computed using its block ID. */ private void verifyFileLocation(File actualBlockFile, File bpFinalizedDir, long blockId) { File expectedBlockDir = DatanodeUtil.idToBlockDir(bpFinalizedDir, blockId); File actualBlockDir = actualBlockFile.getParentFile(); if (actualBlockDir.compareTo(expectedBlockDir) != 0) { LOG.warn("Block: " + blockId + " found in invalid directory. Expected directory: " + expectedBlockDir + ". Actual directory: " + actualBlockDir); } }
/** Just groups together files that have the same ShpFiles instance */ public int compareTo(StorageFile o) { // group togheter files that have the same shpefile instance if (this == o) { return 0; } // assume two StorageFile that do not share the same ShpFiles // are not given the same temp file return getFile().compareTo(o.getFile()); }
@Override public int compareWith(ScanInfo info) { return info.getBlockFile().compareTo(getBlockFile()); }
public int compareTo(final FileDetails o) { if (o == null) { throw new NullPointerException(); } // N.B. this is in reverse order to how we'd normally compare int result = o.getFile().compareTo(file); if (result == 0) { result = ObjectUtils.compare(o.getLastModified(), lastModified); } return result; }
@Override public int compare(DirEntry o1, DirEntry o2) { if (o1.isDirectory() && !o2.isDirectory()) { return -1; } if (!o1.isDirectory() && o2.isDirectory()) { return 1; } return o1.file.compareTo(o2.file); }
@Override public int compare(File file1, File file2) { return file1.compareTo(file2); } });
public int compareTo(Object obj) { if (obj == null || obj.getClass() != MergePath.class) { return -1; } MergePath mergePath = (MergePath) obj; if (this == mergePath) { return 0; } return myPath.compareTo(mergePath.myPath); }
if (!diskMetaFileExists) { LOG.warn(warningPrefix + "null"); } else if (memMetaFile.compareTo(diskMetaFile) != 0) { LOG.warn(warningPrefix + diskMetaFile.getAbsolutePath());
@Override public int compareTo(Dependency arg0) { if(this == arg0) return 0; if(order > arg0.order) return 1; else if(order < arg0.order) return -1; // Filename comparisons aren't very reliable (e.g. "./test" versus "test" are not equals()!), go by getName() first. int ret = newFilename.getName().compareTo(arg0.newFilename.getName()); if(ret != 0) return ret; return newFilename.compareTo(arg0.newFilename); }