/** * @throws Exception If failed. */ @Test public void testCanContain() throws Exception { for (IgfsMode m: IgfsMode.values()) { // Each mode can contain itself: assertTrue(IgfsUtils.canContain(m, m)); // PRIMARY and PROXY can contain itself only: assertTrue(IgfsUtils.canContain(PRIMARY,m) == (m == PRIMARY)); assertTrue(IgfsUtils.canContain(PROXY,m) == (m == PROXY)); // Any mode but PRIMARY & PROXY can contain any mode: if (m != PRIMARY && m != PROXY) for (IgfsMode n: IgfsMode.values()) assertTrue(IgfsUtils.canContain(m,n)); } }
if (!canContain(resMode.getValue(), mode.getValue())) throw new IgniteCheckedException("Subdirectory " + mode.getKey() + " mode " + mode.getValue() + " is not compatible with upper level "
if (!canContain(resMode.getValue(), mode.getValue())) throw new IgniteCheckedException("Subdirectory " + mode.getKey() + " mode " + mode.getValue() + " is not compatible with upper level "