Get object

@param path path to object
@param account Joss account wrapper object
@param scm Swift connection manager
@return SwiftGETResponse input stream and content length
@throws IOException if network issues
427728
public static SwiftInputStreamWrapper getObject(Path path, JossAccount account,
      SwiftConnectionManager scm)
      throws IOException {
    return getObject(path, account, 0, 0, scm);
  }
764637
public Response get(String path) throws IOException, RESTException {
        return get(path, null, null);
    }
1220790
@GET
   @Path("/{path:.*}/")
   public Response getResource(@PathParam("path") String mavenPath, final @Context UriInfo uriInfo,
      final @QueryParam("view") String view, final @QueryParam("gadget") String gadget)
   {

      String resourcePath = mavenRoot + mavenPath; // JCR resource
      String shaResourcePath = mavenPath.endsWith(".sha1") ? mavenRoot + mavenPath : mavenRoot + mavenPath + ".sha1";

      mavenPath = uriInfo.getBaseUriBuilder().path(getClass()).path(mavenPath).build().toString();

      Session ses = null;

      try
      {
         // JCR resource
         SessionProvider sp = sessionProviderService.getSessionProvider(null);
         if (sp == null)
            throw new RepositoryException("Access to JCR Repository denied. SessionProvider is null.");

         ses = sp.getSession(workspace, repositoryService.getRepository(repository));

         ExtendedNode node = (ExtendedNode)ses.getRootNode().getNode(resourcePath);

         if (isFile(node))
         {
            if (view != null && view.equalsIgnoreCase("true"))
            {
               ExtendedNode shaNode = null;
               try
               {
                  shaNode = (ExtendedNode)ses.getRootNode().getNode(shaResourcePath);
               }
               catch (RepositoryException e)
               { // no .sh1 file found
                  if (LOG.isTraceEnabled())
                  {
                     LOG.trace("An exception occurred: " + e.getMessage());
                  }
               }
               return getArtifactInfo(node, mavenPath, gadget, shaNode);
            }
            else
            {
               return downloadArtifact(node);
            }
         }
         else
         {
            return browseRepository(node, mavenPath, gadget);
         }

      }
      catch (PathNotFoundException e)
      {
         if (LOG.isDebugEnabled())
            LOG.debug(e.getLocalizedMessage(), e);
         return Response.status(Response.Status.NOT_FOUND).build();
      }
      catch (AccessDeniedException e)
      {
         if (LOG.isDebugEnabled())
            LOG.debug(e.getLocalizedMessage(), e);
         if (ses == null || ses.getUserID().equals(IdentityConstants.ANONIM))
            return Response.status(Response.Status.UNAUTHORIZED).header(ExtHttpHeaders.WWW_AUTHENTICATE,
               "Basic realm=\"" + realmName + "\"").build();
         else
            return Response.status(Response.Status.FORBIDDEN).build();
      }
      catch (Exception e)
      {
         LOG.error("Failed get maven artifact", e);
         throw new WebApplicationException(e);
      }
      finally
      {
         if (ses != null)
            ses.logout();
      }

   }
991751
public static String readStringFromFile(String path, JavaSparkContext sc) throws IOException {
        return readStringFromFile(path, sc.sc());
    }
818101
public GetData get(String path) {
        GetData command = new GetData();
        command.path(path);
        action.setCommand(command);
        return command;
    }
329678
@Builder(builderClassName = "ProxiedFileSystemFromToken", builderMethodName = "fromToken")
  private static FileSystem getProxiedFileSystemUsingToken(@NonNull String userNameToProxyAs, Token<?> userNameToken,
      URI fsURI, Configuration conf, FileSystem referenceFS) throws IOException, ExecutionException {
    Preconditions.checkNotNull(userNameToProxyAs, "Must provide a user name to proxy as.");
    Preconditions.checkNotNull(userNameToken, "Must provide token for user to proxy.");
    URI actualURI = resolveUri(fsURI, conf, referenceFS);
    Configuration actualConfiguration = resolveConfiguration(conf, referenceFS);

    return USER_NAME_TO_FILESYSTEM_CACHE.get(getFileSystemKey(actualURI, userNameToProxyAs, referenceFS),
        new CreateProxiedFileSystemFromToken(userNameToProxyAs, userNameToken, actualURI, actualConfiguration,
            referenceFS));
  }
477322
@RequestMapping(value = "/findByUsername", method = RequestMethod.GET)
	public @ResponseBody
	ResponseAccount findByUsername(
			@RequestParam(value = "username", required = true) String username) {
		logger.debug("Received request to get account by username");

		ResponseAccount acconut = accountService.getAccountByUsername(username);

		return acconut;

	}
1232110
public ManagedObject get(Token token)
                    throws ObjectManagerException {
        final String methodName = "get";
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass, methodName, new Object[] { token });

        if (gatherStatistics)
            numberOfGetRequests++;

        ManagedObject objectFromStore = null;
        Directory.StoreArea storeArea = (Directory.StoreArea) directory.getEntry(new Long(token.storedObjectIdentifier));

        if (storeArea != null) { // Was the object written?
            if (Tracing.isAnyTracingEnabled() && trace.isDebugEnabled())
                trace.debug(this,
                            cclass,
                            methodName,
                            new Object[] { storeArea });

            java.nio.ByteBuffer serializedBuffer = java.nio.ByteBuffer.allocate((int) storeArea.length);
            getLock.readLock().lock();
            try {
                // Now read the serialized form of the ManagedObject.
                storeChannel.read(serializedBuffer,
                                  storeArea.byteAddress);

            } catch (java.io.IOException exception) {
                // No FFDC Code Needed.
                ObjectManager.ffdc.processException(this, cclass, methodName, exception, "1:480:1.39");

                // check if the file handle is still good
                if (storeChannel.isOpen())
                {
                    TemporaryIOException tioe = new TemporaryIOException(this, exception);
                    if (trace.isEntryEnabled())
                        trace.exit(this,
                                   cclass,
                                   "get",
                                   tioe);
                    throw tioe;
                }
                else
                {
                    // there is nothing more we can do really, so request a shutdown
                    // and throw a permanent ioexception.
                    objectManagerState.requestShutdown();

                    PermanentIOException pioe = new PermanentIOException(this, exception);
                    if (trace.isEntryEnabled())
                        trace.exit(this,
                                   cclass,
                                   "get",
                                   pioe);

                    throw pioe;
                }

            } finally {
                getLock.readLock().unlock();
            } // try... 

            byte[] managedObjectBytes = serializedBuffer.array();

            // For debugging check guardBytes added before and after the serialized ManagedObject.
            if (useGuardBytes) {
                byte[] unGuardedBytes = new byte[-guardBytesLength + managedObjectBytes.length - guardBytesLength];
                for (int i = 0; i < guardBytesLength; i++) {
                    if (managedObjectBytes[i] != managedObjectBytes[guardBytesLength + unGuardedBytes.length + i]) {
                        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
                            trace.exit(this,
                                       cclass,
                                       methodName);
                        throw new GuardBytesException(this,
                                                      token);
                    }
                } // for guardBytes.

                System.arraycopy(managedObjectBytes, // Source.
                                 guardBytesLength, // Source position.
                                 unGuardedBytes, // Destination.
                                 0, // Destination position.
                                 unGuardedBytes.length); // Length.

                managedObjectBytes = unGuardedBytes;
            } // If (useGuardBytes).

            // Recover the ManagedObject from its serialized bytes.
            objectFromStore = ManagedObject.restoreFromSerializedBytes(managedObjectBytes,
                                                                       objectManagerState);
            // Cache the ManagedObject in memory, possibly push out a previously
            // cached ManagedObject.
            cache(objectFromStore);
        } // if (storeArea != null).

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass, methodName, new Object[] { objectFromStore });
        return objectFromStore;
    }
83495
public MockResponse handleGet(String path) {
        MockResponse response = new MockResponse();

        String body = doGet(path);
        if (body == null) {
            response.setResponseCode(404);
        } else {
            response.setResponseCode(200);
            response.setBody(body);
        }
        return response;
    }
258147
public OvhAccount domain_account_accountName_GET(String domain, String accountName) throws IOException {
		String qPath = "/email/domain/{domain}/account/{accountName}";
		StringBuilder sb = path(qPath, domain, accountName);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhAccount.class);
	}
402636
@Override
    public Node get(final String path) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNullOrEmpty(path, "No path was specified");

        // Make a Path
        final ArchivePath realPath = new BasicPath(path);

        // Delegate
        return get(realPath);
    }
206689
public SftpFile getFile(String path) throws SftpStatusException,
			SshException {
		String absolute = getAbsolutePath(path);
		SftpFile file = new SftpFile(absolute, getAttributes(absolute));
		file.sftp = this;
		return file;
	}
767395
def get(path, params = nil, headers = {}, auth = true)
      request(path: path, query: params, headers: headers, auth: auth)
    end
667198
Node getUserNode(Session session, String userName) throws PathNotFoundException, RepositoryException
   {
      return (Node)session.getItem(getUserNodePath(userName));
   }
1047169
@GET
    public JSONObject get(String path, Map<String,String> headers) throws ServiceException, JSONException {
        throw new ServiceException(ServiceException.NOT_ALLOWED, "GET not implemented");
    }
6980
@Override
    @Path("/{solutionId}")
    @ApiOperation(value="Retrieve a solution or all solutions",
        notes="If {solutionId} is not present, returns all solutions.",
        response=Solution.class, responseContainer="List")
    public JSONObject get(String path, Map<String,String> headers) throws ServiceException, JSONException {
        SolutionServices solutionServices = ServiceLocator.getSolutionServices();
        String id = getSegment(path, 1);
        if (id != null) {
            Solution solution = solutionServices.getSolution(id);
            if (solution == null)
                throw new ServiceException(404, "Solution not found: " + id);
            else
                return solution.getJson();
        }
        else {
            Query query = getQuery(path, headers);
            return solutionServices.getSolutions(query).getJson();
        }
    }
84488
public static String get(String host, String path, Map<String, String> params) throws IOException {
        ExceptionUtil.notNull(host);
        return get(host, path, ParamUtil.getUrlParamsByMap(params));
    }