@Override byte[] backup(PatchingTaskContext context) throws IOException { final File[] repoRoots = context.getTargetModulePath(); final String moduleName = contentItem.getName(); final String slot = contentItem.getSlot(); for(final File path : repoRoots) { // Find the first module and calculate the hash final File modulePath = PatchContentLoader.getModulePath(path, moduleName, slot); final File moduleXml = new File(modulePath, MODULE_XML); if(moduleXml.exists()) { PatchLogger.ROOT_LOGGER.debugf("found in path (%s)", moduleXml.getAbsolutePath()); context.invalidateRoot(modulePath); return HashUtils.hashFile(modulePath); } } return notFound(contentItem); }
@Override byte[] backup(PatchingTaskContext context) throws IOException { // Check the bundle dir hash final File[] repoRoots = context.getTargetBundlePath(); final String bundleName = contentItem.getName(); final String slot = contentItem.getSlot(); for(final File path : repoRoots) { // Check the bundle path final File bundlePath = PatchContentLoader.getModulePath(path, bundleName, slot); if(bundlePath.exists()) { PatchLogger.ROOT_LOGGER.debugf("found in path (%s)", bundlePath.getAbsolutePath()); // Bundles don't contain a modules.xml final File[] children = bundlePath.listFiles(); if(children == null || children.length == 0) { return NO_CONTENT; } context.invalidateRoot(bundlePath); return HashUtils.hashFile(bundlePath); } } return NO_CONTENT; }
@Override byte[] backup(PatchingTaskContext context) throws IOException { // Check the bundle dir hash final File[] repoRoots = context.getTargetBundlePath(); final String bundleName = contentItem.getName(); final String slot = contentItem.getSlot(); for(final File path : repoRoots) { // Check the bundle path final File bundlePath = PatchContentLoader.getModulePath(path, bundleName, slot); if(bundlePath.exists()) { PatchLogger.ROOT_LOGGER.debugf("found in path (%s)", bundlePath.getAbsolutePath()); // Bundles don't contain a modules.xml final File[] children = bundlePath.listFiles(); if(children == null || children.length == 0) { return NO_CONTENT; } context.invalidateRoot(bundlePath); return HashUtils.hashFile(bundlePath); } } return NO_CONTENT; }
@Override byte[] backup(PatchingTaskContext context) throws IOException { final File[] repoRoots = context.getTargetModulePath(); final String moduleName = contentItem.getName(); final String slot = contentItem.getSlot(); for(final File path : repoRoots) { // Find the first module and calculate the hash final File modulePath = PatchContentLoader.getModulePath(path, moduleName, slot); final File moduleXml = new File(modulePath, MODULE_XML); if(moduleXml.exists()) { PatchLogger.ROOT_LOGGER.debugf("found in path (%s)", moduleXml.getAbsolutePath()); context.invalidateRoot(modulePath); return HashUtils.hashFile(modulePath); } } return notFound(contentItem); }