FileBasedObjectStore implements PersistenceObjectStore { @Override public void createSubPath(String subPath) { if (!prepared) throw new IllegalStateException("Not yet prepared: "+this); File dir = new File(getBaseDir(), subPath); if (dir.mkdir()) { try { FileUtil.setFilePermissionsTo700(dir); } catch (IOException e) { log.warn("Unable to set sub-directory permissions to 700 (continuing): "+dir); } } else { if (!dir.exists()) throw new IllegalStateException("Cannot create "+dir+"; call returned false"); } checkPersistenceDirAccessible(dir); } FileBasedObjectStore(File basedir); @Override String getSummaryName(); File getBaseDir(); @Override synchronized void prepareForMasterUse(); @Override void createSubPath(String subPath); @Override StoreObjectAccessor newAccessor(String path); @Override List<String> listContentsWithSubPath(final String parentSubPath); @Override void close(); @Override String toString(); @Override void injectManagementContext(ManagementContext mgmt); @Override void prepareForSharedUse(@Nullable PersistMode persistMode, HighAvailabilityMode haMode); @Override void deleteCompletely(); static void deleteCompletely(File d);  }
@Test(groups="Integration") public void testSubPathCreatedWithPermission700() throws Exception { store.createSubPath("mysubdir"); File subdir = new File(basedir, "mysubdir"); assertFilePermission700(basedir); assertFilePermission700(subdir); }