/** * Creates a new {@link MountInfoProvider} * * @return a newly-created MountInfoProvider */ public MountInfoProvider build() { return new SimpleMountInfoProvider(mounts); } }
SimpleMountInfoProvider(List<Mount> mountInfos) { this.mounts = getMounts(mountInfos); this.hasMounts = !this.mounts.isEmpty(); this.defMount = defaultMount(this.mounts); //TODO add validation of mountpoints }
SimpleMountInfoProvider(List<Mount> mountInfos) { this.mounts = getMounts(mountInfos); this.hasMounts = !this.mounts.isEmpty(); this.defMount = defaultMount(this.mounts); //TODO add validation of mountpoints }
/** * Creates a new {@link MountInfoProvider} * * @return a newly-created MountInfoProvider */ public MountInfoProvider build() { return new SimpleMountInfoProvider(mounts); } }
@Test public void defaultMount() throws Exception { MountInfoProvider mip = new SimpleMountInfoProvider(Collections.<Mount>emptyList()); assertNotNull(mip.getMountByPath("/a")); assertTrue(mip.getMountByPath("/a").isDefault()); assertFalse(mip.hasNonDefaultMounts()); }