Package org.glassfish.jersey.server

Examples of org.glassfish.jersey.server.ResourceFinder


            final Set<String> resourcePaths = sc.getResourcePaths(path);
            if (resourcePaths == null) {
                break;
            }

            resourceFinderStack.push(new ResourceFinder() {

                private Deque<String> resourcePathsStack = new LinkedList<String>() {

                    private static final long serialVersionUID = 3109256773218160485L;
View Full Code Here


        public void reset() {
            throw new UnsupportedOperationException();
        }

        private void processFile(final File f) {
            resourceFinderStack.push(new ResourceFinder() {

                Stack<File> files = new Stack<File>() {{
                    if(f.isDirectory()) {
                        final File[] subDirFiles = f.listFiles();
                        if (subDirFiles != null) {
View Full Code Here

                // logging might be sufficient in this case
                throw new ResourceFinderException(e);
            }

        } else {
            resourceFinderStack.push(new ResourceFinder() {

                Stack<File> files = new Stack<File>() {{
                    if (f.isDirectory()) {
                        final File[] subDirFiles = f.listFiles();
                        if (subDirFiles != null) {
View Full Code Here

    }


    @Test
    public void test() {
        ResourceFinder i = new MyIterator();
        ResourceFinder j = new MyIterator();

        ResourceFinderStack iteratorStack = new ResourceFinderStack();
        iteratorStack.push(i);
        iteratorStack.push(j);
View Full Code Here

        final VirtualFile mountDir = VFS.getChild("content");
        ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
        try (TempFileProvider provider = TempFileProvider.create("test", executor, false);
             Closeable mount = VFS.mountZip(VFS.getChild(jaxRsApiPath), mountDir, provider)) {

            ResourceFinder finder = new VfsSchemeResourceFinderFactory().create(new URI(mountDir.toURI().toString() + "/javax/ws/rs"), true);

            int scannedEntryCount = 0;
            while (finder.hasNext()) {
                // Fetch next entry.
                finder.next();

                // This test doesn't actually do anything with the input stream, but it is important that it
                // open/close the stream to simulate actual usage.  The reported defect is only exposed if you
                // call open/close in some fashion.

                try (InputStream classStream = finder.open()) {
                    scannedEntryCount++;
                }
            }

            assertThat("Failed to enumerate all contents of javax.ws.rs-api.", scannedEntryCount, equalTo(actualEntries));
View Full Code Here

TOP

Related Classes of org.glassfish.jersey.server.ResourceFinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.