List of usage examples for java.util EnumSet of
public static <E extends Enum<E>> EnumSet<E> of(E e)
From source file:com.dm.platform.listener.base.MyServletContextListener.java
@Override public void contextInitialized(ServletContextEvent sce) { System.out.println("MyServletContextListener"); ServletContext sc = sce.getServletContext(); ServletRegistration sr = sc.addServlet("spring", DispatcherServlet.class); sr.setInitParameter("contextConfigLocation", "/WEB-INF/dispatcher-servlet.xml"); sr.addMapping("/spring/*"); FilterRegistration fr = sc.addFilter(DynamicRegistFilter.class.getSimpleName(), DynamicRegistFilter.class); fr.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/platform/*"); // fr = sc.addFilter(DelegatingFilterProxy.class.getSimpleName(), DelegatingFilterProxy.class); // fr.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/platform/*"); sc.addListener(new ContextLoaderListener()); }
From source file:com.dm.platform.listener.PlatformServletContextListener.java
@Override public void contextInitialized(ServletContextEvent sce) { System.out.println("contextInitialized"); ServletContext sc = sce.getServletContext(); sc.setInitParameter("contextConfigLocation", "/WEB-INF/applicationContext.xml"); // sc.addListener(ContextLoaderListener.class); FilterRegistration fr = sc.addFilter(DelegatingFilterProxy.class.getSimpleName(), DelegatingFilterProxy.class); fr.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/spring/*"); ServletRegistration sr = sc.addServlet("spring", DispatcherServlet.class); sr.setInitParameter("contextConfigLocation", "/WEB-INF/dispatcher-servlet.xml /WEB-INF/platform-security.xml"); sr.addMapping("/spring/*"); fr = sc.addFilter(DynamicRegistFilter.class.getSimpleName(), DynamicRegistFilter.class); fr.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/platform/*"); }
From source file:io.swagger.inflector.config.DirectionDeserializerTest.java
@Test public void testFromArray() throws Exception { try (InputStream in = DirectionDeserializerTest.class.getResourceAsStream("validation-as-set.yaml")) { final Holder holder = Yaml.mapper().readValue(in, Holder.class); Assert.assertEquals(holder.getValue(), EnumSet.of(Configuration.Direction.IN)); }//w ww . ja v a2 s .c o m }
From source file:ch.cyberduck.core.nio.LocalHomeFinderFeature.java
protected Path toPath(final String home) { return new Path(StringUtils.replace(home, "\\", "/"), EnumSet.of(Path.Type.directory)); }
From source file:ch.cyberduck.cli.DeletePathFinderTest.java
@Test public void testFindDirectory() throws Exception { final CommandLineParser parser = new PosixParser(); final CommandLine input = parser.parse(TerminalOptionsBuilder.options(), new String[] { "--delete", "rackspace://cdn.cyberduck.ch/remote" }); assertTrue(new DeletePathFinder() .find(input, TerminalAction.delete, new Path("/remote", EnumSet.of(Path.Type.directory))) .contains(new TransferItem(new Path("/remote", EnumSet.of(Path.Type.directory))))); }
From source file:net.lmxm.ute.gui.components.FilesTableModel.java
/** * Instantiates a new files table model. * // w w w . j a v a2 s .c om * @param filesTask the files task */ public FilesTableModel(final FilesTask filesTask) { super(EnumSet.of(TableColumnResourceType.FILE_NAME)); rowData = filesTask.getFiles(); cleanRowData(); }
From source file:org.simbasecurity.core.event.EventServiceTest.java
@Before public void setUp() throws Exception { when(ruleChangedInterestListener.getTypesOfInterest()).thenReturn(EnumSet.of(SimbaEventType.RULE_CHANGED)); when(noInterestListener.getTypesOfInterest()).thenReturn(EnumSet.noneOf(SimbaEventType.class)); eventService.postProcessAfterInitialization(ruleChangedInterestListener, "ruleChangedInterest"); eventService.postProcessAfterInitialization(noInterestListener, "noInterest"); }
From source file:ch.cyberduck.cli.GlobTransferItemFinderTest.java
@Test public void testNoLocalInOptionsDownload() throws Exception { final CommandLineParser parser = new PosixParser(); final CommandLine input = parser.parse(TerminalOptionsBuilder.options(), new String[] { "--download", "rackspace://cdn.cyberduck.ch/remote" }); final Set<TransferItem> found = new GlobTransferItemFinder().find(input, TerminalAction.download, new Path("/cdn.cyberduck.ch/remote", EnumSet.of(Path.Type.file))); assertFalse(found.isEmpty());//from ww w. ja v a 2s. co m assertEquals(new TransferItem(new Path("/cdn.cyberduck.ch/remote", EnumSet.of(Path.Type.file)), LocalFactory.get(System.getProperty("user.dir") + "/remote")), found.iterator().next()); }
From source file:de.cosmocode.hibernate.EnumSetRestriction.java
public EnumSetRestriction(String propertyName, String bitOp, E e, String op, long value) { this(propertyName, bitOp, EnumSet.of(e), op, value); }
From source file:ch.cyberduck.core.cryptomator.CryptoChecksumComputeTest.java
@Test public void testCompute() throws Exception { final Path vault = new Path("/vault", EnumSet.of(Path.Type.directory)); final NullSession session = new NullSession(new Host(new TestProtocol())) { @Override/*from ww w . j av a2s.c o m*/ @SuppressWarnings("unchecked") public <T> T _getFeature(final Class<T> type) { if (type == Directory.class) { return (T) new Directory() { @Override public Path mkdir(final Path folder, final String region, final TransferStatus status) throws BackgroundException { assertTrue(folder.equals(vault) || folder.isChild(vault)); return folder; } @Override public boolean isSupported(final Path workdir) { return true; } @Override public Directory withWriter(final Write writer) { return this; } }; } return super._getFeature(type); } }; final CryptoVault cryptomator = new CryptoVault(vault, new DisabledPasswordStore()); cryptomator.create(session, null, new VaultCredentials("test")); final Cryptor cryptor = cryptomator.getCryptor(); final ByteBuffer header = cryptor.fileHeaderCryptor().encryptHeader(cryptor.fileHeaderCryptor().create()); // DEFAULT_PIPE_SIZE=1024 final Path file = new Path(vault, "f", EnumSet.of(Path.Type.file)); final SHA256ChecksumCompute sha = new SHA256ChecksumCompute(); final CryptoChecksumCompute compute = new CryptoChecksumCompute(sha, cryptomator); final RandomNonceGenerator nonces = new RandomNonceGenerator(); assertNotNull(compute.compute(new NullInputStream(1025L), new TransferStatus().withHeader(header).withNonces(nonces)).hash); assertNotEquals( compute.compute(new NullInputStream(1025L), new TransferStatus().withHeader(header).withNonces(nonces)), compute.compute(new NullInputStream(1025L), new TransferStatus().withHeader(header).withNonces(nonces))); assertNotNull(compute.compute(new NullInputStream(0L), new TransferStatus().withHeader(header).withNonces(nonces)).hash); final NullInputStream input = new NullInputStream(0L); assertEquals(compute.compute(input, new TransferStatus().withHeader(header).withNonces(nonces)), compute.compute(input, new TransferStatus().withHeader(header).withNonces(nonces))); assertNotEquals( compute.compute(new NullInputStream(0L), new TransferStatus().withHeader(header).withNonces(nonces)), sha.compute(new NullInputStream(0L), new TransferStatus())); }