use of org.jboss.galleon.diff.FsEntryFactory in project galleon by wildfly.
the class FsDiffTestBase method test.
@Test
public void test() throws Exception {
initOriginal();
initOther();
final FsEntryFactory factory = FsEntryFactory.getInstance();
initFactory(factory);
assertDiff(FsDiff.diff(factory.forPath(original), factory.forPath(other)));
}
use of org.jboss.galleon.diff.FsEntryFactory in project galleon by wildfly.
the class FsEntriesTestBase method test.
@Test
public void test() throws Exception {
initFs();
final FsEntryFactory factory = FsEntryFactory.getInstance();
initFactory(factory);
assertRootEntry(factory.forPath(root));
}
use of org.jboss.galleon.diff.FsEntryFactory in project galleon by wildfly.
the class ProvisioningManager method getFsDiff.
/**
* Returns the status of the filesystem describing which files have been
* added, removed and modified since the last provisioning state transition.
*
* @return current status of the filesystem
* @throws ProvisioningException in case of an error during the status check
*/
public FsDiff getFsDiff() throws ProvisioningException {
final ProvisioningConfig config = getProvisioningConfig();
if (config == null || !config.hasFeaturePackDeps()) {
return null;
}
log.verbose("Detecting user changes");
final Path hashesDir = LayoutUtils.getHashesDir(getInstallationHome());
if (Files.exists(hashesDir)) {
final FsEntry originalState = new FsEntry(null, hashesDir);
readHashes(originalState, new ArrayList<>());
final FsEntry currentState = getDefaultFsEntryFactory().forPath(getInstallationHome());
return FsDiff.diff(originalState, currentState);
}
try (ProvisioningRuntime rt = getRuntime(config)) {
rt.provision();
final FsEntryFactory fsFactory = getDefaultFsEntryFactory();
final FsEntry originalState = fsFactory.forPath(rt.getStagedDir());
final FsEntry currentState = fsFactory.forPath(getInstallationHome());
final long startTime = log.isVerboseEnabled() ? System.nanoTime() : -1;
final FsDiff fsDiff = FsDiff.diff(originalState, currentState);
if (startTime != -1) {
log.verbose(Errors.tookTime(" filesystem diff", startTime));
}
return fsDiff;
}
}
Aggregations