/** * Determine whether to mount the archive. * * @param virtualFile to check * @return true if the {@link VirtualFile} should be mounted */ protected boolean shouldMount(VirtualFile virtualFile) { return virtualFile.isFile() && hasValidName(virtualFile); }
/** * Determine whether the {@link VirtualFile} has a name that matches this structure. * Defaults to just checking the suffix. * * @param root the {@link VirtualFile} root to check * @return true if the file name is valid for this {@link StructureDeployer} */ protected boolean hasValidName(VirtualFile root) { return hasValidSuffix(root.getName()); }
if (shouldMount(root) == false || mountArchive(root) == false) valid = doDetermineStructure(context);
/** * Mounts the the provided file as an archive using the {@link Automounter} * * @param file the file to mount * @return true if the mount was successful * @throws DeploymentException for any deployment error */ private boolean mountArchive(VirtualFile file) throws DeploymentException { try { performMount(file); } catch (IOException e) { throw DeploymentException.rethrowAsDeploymentException("Failed to mount archive: " + file, e); } return true; }