); createNewEntry(newInfo, trashId, newInfo.id().toString());
/** * Add file into file system structure. Do not create new transaction expecting that the one already exists. * * @param parentId Parent file ID. * @param fileName File name in the parent's listing. * @param newFileInfo File info to store in the parent's listing. * @return File id already stored in meta cache or {@code null} if passed file info was stored. * @throws IgniteCheckedException If failed. */ private IgniteUuid putIfAbsentNonTx(IgniteUuid parentId, String fileName, IgfsEntryInfo newFileInfo) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Locking parent id [parentId=" + parentId + ", fileName=" + fileName + ", newFileInfo=" + newFileInfo + ']'); validTxState(true); // Lock only parent file ID. IgfsEntryInfo parentInfo = info(parentId); if (parentInfo == null) throw fsException(new IgfsPathNotFoundException("Failed to lock parent directory (not found): " + parentId)); if (!parentInfo.isDirectory()) throw fsException(new IgfsPathIsNotDirectoryException("Parent file is not a directory: " + parentInfo)); IgfsListingEntry childEntry = parentInfo.listing().get(fileName); if (childEntry != null) return childEntry.fileId(); createNewEntry(newFileInfo, parentId, fileName); return null; }
path.name(), parentInfo.listing().get(path.name()).fileId())); createNewEntry(newInfo, parentInfo.id(), path.name()); // Put new one.
); createNewEntry(newInfo, trashId, newInfo.id().toString());
/** * Add file into file system structure. Do not create new transaction expecting that the one already exists. * * @param parentId Parent file ID. * @param fileName File name in the parent's listing. * @param newFileInfo File info to store in the parent's listing. * @return File id already stored in meta cache or {@code null} if passed file info was stored. * @throws IgniteCheckedException If failed. */ private IgniteUuid putIfAbsentNonTx(IgniteUuid parentId, String fileName, IgfsEntryInfo newFileInfo) throws IgniteCheckedException { if (log.isDebugEnabled()) log.debug("Locking parent id [parentId=" + parentId + ", fileName=" + fileName + ", newFileInfo=" + newFileInfo + ']'); validTxState(true); // Lock only parent file ID. IgfsEntryInfo parentInfo = info(parentId); if (parentInfo == null) throw fsException(new IgfsPathNotFoundException("Failed to lock parent directory (not found): " + parentId)); if (!parentInfo.isDirectory()) throw fsException(new IgfsPathIsNotDirectoryException("Parent file is not a directory: " + parentInfo)); IgfsListingEntry childEntry = parentInfo.listing().get(fileName); if (childEntry != null) return childEntry.fileId(); createNewEntry(newFileInfo, parentId, fileName); return null; }
path.name(), parentInfo.listing().get(path.name()).fileId())); createNewEntry(newInfo, parentInfo.id(), path.name()); // Put new one.