Examples of resource()


Examples of org.apache.wink.client.RestClient.resource()

        server.startServer();
        try {
            RestClient client = getRestClient();
            Resource resource =
                client.resource(MessageFormat.format(SERVICE_URL, String.valueOf(server
                    .getServerPort())));
            String response = resource.accept(MediaType.TEXT_PLAIN_TYPE).get(String.class);
            assertEquals("REQUEST", response);

        } finally {
View Full Code Here

Examples of org.apache.wink.client.RestClient.resource()

        server.startServer();
        try {
            RestClient client = getRestClient();
            Resource resource =
                client.resource(MessageFormat.format(SERVICE_URL, String.valueOf(server
                    .getServerPort())));
            String response = resource.accept(MediaType.TEXT_PLAIN_TYPE).get(String.class);
            assertEquals("REQUEST", response);
        } finally {
            server.stopServer();
View Full Code Here

Examples of org.apache.wink.server.utils.SingleLinkBuilder.resource()

            .getId()).build(entry.getLinks());

        // generate related links - each defect can access its tests
        SingleLinkBuilder singleLinkBuilder = linkProcessor.createSingleLinkBuilder();

        singleLinkBuilder.resource(DefectTestsResource.class).pathParam(DefectsResource.DEFECT_VAR,
                                                                        defect.getId())
            .rel("related").type(MediaType.APPLICATION_ATOM_XML_TYPE).build(entry.getLinks());

        // add attachment link
        if (defect.getPathToAttachment() != null && defect.getPathToAttachment().length() > 0) {
View Full Code Here

Examples of org.apache.wink.server.utils.SingleLinkBuilder.resource()

                                                                        defect.getId())
            .rel("related").type(MediaType.APPLICATION_ATOM_XML_TYPE).build(entry.getLinks());

        // add attachment link
        if (defect.getPathToAttachment() != null && defect.getPathToAttachment().length() > 0) {
            singleLinkBuilder.resource(DefectsResource.class)
                .subResource(DefectsResource.DEFECT_ATTACHMENT_PATH)
                .pathParam(DefectsResource.DEFECT_VAR, defect.getId()).rel("attachment")
                .type(MediaTypeUtils.IMAGE_JPEG_TYPE).build(entry.getLinks());
        }
View Full Code Here

Examples of org.apache.wink.server.utils.SystemLinksBuilder.resource()

                       "alternate",
                       "application/atom+xml",
                       "systemLinks/ContinuedSearch?alt=application%2Fatom%2Bxml");

            links = new ArrayList<SyndLink>();
            builder.resource(SystemLinksContinuedSearch3Resource.class)
                .pathParam("v1", "Continued").pathParam("v2", "Search").allResources(true)
                .build(links);
            assertEquals(6, links.size());
            assertLink(links, "self", null, "systemLinks/ContinuedSearch");
            assertLink(links, "edit", null, "systemLinks/ContinuedSearch");
View Full Code Here

Examples of org.atmosphere.websocket.WebSocket.resource()

        if (o == null) return;

        if (WebSocket.class.isAssignableFrom(o.getClass())) {
            WebSocket webSocket = WebSocket.class.cast(o);
            AtmosphereResource r = webSocket.resource();

            logger.trace("Closing {}", r != null ? r.uuid() : "NULL");

            try {
                webSocketProcessor.close(webSocket, 1005);
View Full Code Here

Examples of org.compass.core.CompassHits.resource()

                                    SortDirection.REVERSE).hits();
                    log.debug("search string " + searchString + " hits "
                            + hits.length());
                    for (int i = start; i < hits.length()
                            && i < max_num_hits; i++) {
                        String name = hits.resource(i).get("name");
                        // log.debug("search string " + searchString
                        // + " hit: " + name + " "
                        // + hits.resource(i));
                        if (name != null) {
                            rtn.add(name);
View Full Code Here

Examples of org.eclipse.jdt.internal.core.ClassFile.resource()

          // find the type declaration that corresponds to the original source type
          typeDeclaration = new ASTNodeFinder(parsedUnit).findType(context);
        }
      } else { // binary type
        ClassFile classFile = (ClassFile) context.getClassFile();
        ClassFileReader reader = (ClassFileReader) classFile.getBinaryTypeInfo((IFile) classFile.resource(), false/*don't fully initialize so as to keep constant pool (used below)*/);
        CompilationResult result = new CompilationResult(reader.getFileName(), 1, 1, this.compilerOptions.maxProblemsPerUnit);
        parsedUnit = new CompilationUnitDeclaration(this.parser.problemReporter(), result, 0);
        HashSetOfCharArrayArray typeNames = new HashSetOfCharArrayArray();

        BinaryTypeConverter converter = new BinaryTypeConverter(this.parser.problemReporter(), result, typeNames);
View Full Code Here

Examples of org.eclipse.jdt.internal.core.PackageFragment.resource()

        if (pkgEnd != -1)
          pkg = (PackageFragment) Util.getPackageFragment(sourceFile.getFileName(), pkgEnd, -1 /*no jar separator for java files*/);
       
        if (pkg != null) {
          try {
            IMarker[] existingMarkers = pkg.resource().findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
            int len = existingMarkers.length;
            for (int j=0; j < len; j++) {
              if (((Integer)existingMarkers[j].getAttribute(IJavaModelMarker.ID)).intValue() == IProblem.MissingNonNullByDefaultAnnotationOnPackage) {
                continue problems; // marker already present
              }
View Full Code Here

Examples of org.eclipse.jdt.internal.core.PackageFragmentRoot.resource()

    case IJavaElement.PACKAGE_FRAGMENT_ROOT:
      root = (PackageFragmentRoot)element;
      IPath rootPath = root.internalPath();
      containerPath = root.getKind() == IPackageFragmentRoot.K_SOURCE ? root.getParent().getPath() : rootPath;
      containerPathToString = containerPath.getDevice() == null ? containerPath.toString() : containerPath.toOSString();
      IResource rootResource = root.resource();
      String projectPath = root.getJavaProject().getPath().toString();
      if (rootResource != null && rootResource.isAccessible()) {
        String relativePath = Util.relativePath(rootResource.getFullPath(), containerPath.segmentCount());
        add(projectPath, relativePath, containerPathToString, false/*not a package*/, null);
      } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.