@NotNull public static String getPermissionRootName(@NotNull Mount mount, @NotNull String workspace) { if (mount.isDefault()) { return workspace; } else { return mount.getPathFragmentName() + "-" + workspace; } }
public static String getSuggestDirName(Mount mount) { if (mount.isDefault()){ return SUGGEST_DATA_CHILD_NAME; } String name = mount.getPathFragmentName(); return ":" + name + SUGGEST_DIR_SUFFIX; }
@Nonnull public static String getPermissionRootName(@Nonnull Mount mount, @Nonnull String workspace) { if (mount.isDefault()) { return workspace; } else { return mount.getPathFragmentName() + "-" + workspace; } }
public static String getIndexDirName(Mount mount) { if (mount.isDefault()){ return FulltextIndexConstants.INDEX_DATA_CHILD_NAME; } String name = mount.getPathFragmentName(); return ":" + name + INDEX_DIR_SUFFIX; }
public static String getIndexDirName(Mount mount) { if (mount.isDefault()){ return FulltextIndexConstants.INDEX_DATA_CHILD_NAME; } String name = mount.getPathFragmentName(); return ":" + name + INDEX_DIR_SUFFIX; }
@NotNull public static String getPermissionRootName(@NotNull Mount mount, @NotNull String workspace) { if (mount.isDefault()) { return workspace; } else { return mount.getPathFragmentName() + "-" + workspace; } }
public static String getSuggestDirName(Mount mount) { if (mount.isDefault()){ return SUGGEST_DATA_CHILD_NAME; } String name = mount.getPathFragmentName(); return ":" + name + SUGGEST_DIR_SUFFIX; }
private boolean hasChildrenContainingPathFragmentName(MountedNodeStore mns, String parentPath, Function<MountedNodeStore, Iterable<String>> childrenProvider) { final Mount mount = mns.getMount(); if (!mount.isSupportFragment(parentPath)) { return false; } return StreamSupport.stream(childrenProvider.apply(mns).spliterator(), false) .anyMatch(i -> i.contains(mount.getPathFragmentName())); }
public InitialContentMigrator(NodeStore targetNodeStore, NodeStore seedNodeStore, Mount seedMount) { this.targetNodeStore = targetNodeStore; this.seedNodeStore = seedNodeStore; this.seedMount = seedMount; this.includePaths = FilteringNodeState.ALL; this.excludeFragments = ImmutableSet.of(seedMount.getPathFragmentName()); if (seedMount instanceof MountInfo) { this.excludePaths = Sets.union(((MountInfo) seedMount).getIncludedPaths(), DEFAULT_IGNORED_PATHS); this.fragmentPaths = new HashSet<>(); for (String p : ((MountInfo) seedMount).getPathsSupportingFragments()) { fragmentPaths.add(stripPatternCharacters(p)); } } else { this.excludePaths = DEFAULT_IGNORED_PATHS; this.fragmentPaths = FilteringNodeState.ALL; } }
public static String getNodeForMount(Mount mount, String defaultName) { if (mount.isDefault()) { return defaultName; } return ":" + mount.getPathFragmentName() + asSuffix(defaultName); }
public static String getNodeForMount(Mount mount, String defaultName) { if (mount.isDefault()) { return defaultName; } return ":" + mount.getPathFragmentName() + asSuffix(defaultName); }
public static String getNodeForMount(Mount mount, String defaultName) { if (mount.isDefault()) { return defaultName; } return ":" + mount.getPathFragmentName() + asSuffix(defaultName); }
@Test public void customNodeName() throws Exception { MountInfoProvider mip = Mounts.newBuilder() .mount("foo", "/a", "/b").build(); Mount m = mip.getMountByName("foo"); assertEquals(":index", getIndexNodeName(mip, "/foo", INDEX_CONTENT_NODE_NAME)); assertEquals(":index", getNodeForMount(mip.getDefaultMount(), INDEX_CONTENT_NODE_NAME)); assertEquals(":" + m.getPathFragmentName() + "-index", getIndexNodeName(mip, "/a", INDEX_CONTENT_NODE_NAME)); assertEquals(":" + m.getPathFragmentName() + "-index", getNodeForMount(m, INDEX_CONTENT_NODE_NAME)); } }