/** * Whether the pack file extension is known to exist. * * @param ext * the file extension * @return whether the pack file extension is known to exist. */ public boolean hasFileExt(PackExt ext) { return (extensions & ext.getBit()) != 0; }
/** * Adds the pack file extension to the known list. * * @param ext * the file extension */ public void addFileExt(PackExt ext) { extensions |= ext.getBit(); }
private boolean hasExt(PackExt ext) { return (extensions & ext.getBit()) != 0; } }
/** {@inheritDoc} */ @Override public String toString() { return String.format("PackExt[%s, bit=0x%s]", getExtension(), //$NON-NLS-1$ Integer.toHexString(getBit())); } }
/** * {@inheritDoc} * <p> * Add a single existing pack to the list of available pack files. */ @Override public PackFile openPack(File pack) throws IOException { final String p = pack.getName(); if (p.length() != 50 || !p.startsWith("pack-") || !p.endsWith(".pack")) //$NON-NLS-1$ //$NON-NLS-2$ throw new IOException(MessageFormat.format(JGitText.get().notAValidPack, pack)); // The pack and index are assumed to exist. The existence of other // extensions needs to be explicitly checked. // int extensions = PACK.getBit() | INDEX.getBit(); final String base = p.substring(0, p.length() - 4); for (PackExt ext : PackExt.values()) { if ((extensions & ext.getBit()) == 0) { final String name = base + ext.getExtension(); if (new File(pack.getParentFile(), name).exists()) extensions |= ext.getBit(); } } PackFile res = new PackFile(pack, extensions); insertPack(res); return res; }
/** * @param ext * the file extension * @return whether the pack file extensions is known to exist. */ public boolean hasFileExt(PackExt ext) { return (extensions & ext.getBit()) != 0; }
/** * Adds the pack file extension to the known list. * * @param ext * the file extension */ public void addFileExt(PackExt ext) { extensions |= ext.getBit(); }
/** * Adds the pack file extension to the known list. * * @param ext * the file extension */ public void addFileExt(PackExt ext) { extensions |= ext.getBit(); }
private boolean hasExt(PackExt ext) { return (extensions & ext.getBit()) != 0; } }
/** * Whether the pack file extension is known to exist. * * @param ext * the file extension * @return whether the pack file extension is known to exist. */ public boolean hasFileExt(PackExt ext) { return (extensions & ext.getBit()) != 0; }
private boolean hasExt(PackExt ext) { return (extensions & ext.getBit()) != 0; } }
@Override public String toString() { return String.format("PackExt[%s, bit=0x%s]", getExtension(), //$NON-NLS-1$ Integer.toHexString(getBit())); } }
/** {@inheritDoc} */ @Override public String toString() { return String.format("PackExt[%s, bit=0x%s]", getExtension(), //$NON-NLS-1$ Integer.toHexString(getBit())); } }
/** * {@inheritDoc} * <p> * Add a single existing pack to the list of available pack files. */ @Override public PackFile openPack(File pack) throws IOException { final String p = pack.getName(); if (p.length() != 50 || !p.startsWith("pack-") || !p.endsWith(".pack")) //$NON-NLS-1$ //$NON-NLS-2$ throw new IOException(MessageFormat.format(JGitText.get().notAValidPack, pack)); // The pack and index are assumed to exist. The existence of other // extensions needs to be explicitly checked. // int extensions = PACK.getBit() | INDEX.getBit(); final String base = p.substring(0, p.length() - 4); for (PackExt ext : PackExt.values()) { if ((extensions & ext.getBit()) == 0) { final String name = base + ext.getExtension(); if (new File(pack.getParentFile(), name).exists()) extensions |= ext.getBit(); } } PackFile res = new PackFile(pack, extensions); insertPack(res); return res; }
int extensions = PACK.getBit() | INDEX.getBit(); final String base = p.substring(0, p.length() - 4); for (PackExt ext : PackExt.values()) { if ((extensions & ext.getBit()) == 0) { final String name = base + ext.getExtension(); if (new File(pack.getParentFile(), name).exists()) extensions |= ext.getBit();