/** * List child files for specified file ID. * * @param fileId File to list child files for. * @return Directory listing for the specified file. * @throws GridException If failed. */ public Map<String, GridGgfsListingEntry> directoryListing(GridUuid fileId) throws GridException { if (busyLock.enterBusy()) { try { return directoryListing(fileId, false); } finally { busyLock.leaveBusy(); } } else throw new IllegalStateException("Failed to get directory listing because Grid is stopping: " + fileId); }
/** * List child files for specified file ID. * * @param fileId File to list child files for. * @return Directory listing for the specified file. * @throws GridException If failed. */ public Map<String, GridGgfsListingEntry> directoryListing(GridUuid fileId) throws GridException { if (busyLock.enterBusy()) { try { return directoryListing(fileId, false); } finally { busyLock.leaveBusy(); } } else throw new IllegalStateException("Failed to get directory listing because Grid is stopping: " + fileId); }
/** * Gets file ID by its name from parent directory listing possibly skipping existing transaction. * * @param parentId Parent directory ID to get child ID for. * @param fileName File name in parent listing to get file ID for. * @param skipTx Whether to skip existing transaction. * @return File ID. * @throws GridException If failed. */ @Nullable private GridUuid fileId(GridUuid parentId, String fileName, boolean skipTx) throws GridException { GridGgfsListingEntry entry = directoryListing(parentId, skipTx).get(fileName); if (entry == null) { if (log.isDebugEnabled()) log.debug("Missing file ID [parentId=" + parentId + ", fileName=" + fileName + ']'); return null; } return entry.fileId(); }
/** * Gets file ID by its name from parent directory listing possibly skipping existing transaction. * * @param parentId Parent directory ID to get child ID for. * @param fileName File name in parent listing to get file ID for. * @param skipTx Whether to skip existing transaction. * @return File ID. * @throws GridException If failed. */ @Nullable private GridUuid fileId(GridUuid parentId, String fileName, boolean skipTx) throws GridException { GridGgfsListingEntry entry = directoryListing(parentId, skipTx).get(fileName); if (entry == null) { if (log.isDebugEnabled()) log.debug("Missing file ID [parentId=" + parentId + ", fileName=" + fileName + ']'); return null; } return entry.fileId(); }
files.addAll(meta.directoryListing(fileId).keySet()); else if (mode == PRIMARY) { checkConflictWithPrimary(path);
files.addAll(meta.directoryListing(fileId).keySet()); else if (mode == PRIMARY) { checkConflictWithPrimary(path);
Map<String, GridGgfsListingEntry> infoMap = meta.directoryListing(desc.fileId);
Map<String, GridGgfsListingEntry> infoMap = meta.directoryListing(desc.fileId);