MinioClient.getObject() example.
515538
public static void main(String[] args)
    throws IOException, NoSuchAlgorithmException, InvalidKeyException, XmlPullParserException {
    try {
      /* play.min.io for test and development. */
      MinioClient minioClient = new MinioClient("https://play.min.io:9000", "Q3AM3UQ867SPQQA43P2F",
                                                "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG");

      /* Amazon S3: */
      // MinioClient minioClient = new MinioClient("https://s3.amazonaws.com", "YOUR-ACCESSKEYID",
      //                                           "YOUR-SECRETACCESSKEY");

      // Check whether the object exists using statObject().  If the object is not found,
      // statObject() throws an exception.  It means that the object exists when statObject()
      // execution is successful.
      minioClient.statObject("my-bucketname", "my-objectname");

      // Get input stream to have content of 'my-objectname' from 'my-bucketname'
      InputStream stream = minioClient.getObject("my-bucketname", "my-objectname");

      // Read the input stream and print to the console till EOF.
      byte[] buf = new byte[16384];
      int bytesRead;
      while ((bytesRead = stream.read(buf, 0, buf.length)) >= 0) {
        System.out.println(new String(buf, 0, bytesRead, StandardCharsets.UTF_8));
      }

      // Close the input stream.
      stream.close();
    } catch (MinioException e) {
      System.out.println("Error occurred: " + e);
    }
  }
154029
@Override
    public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> env)
                    throws Exception {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();

        // -----------------------------------------------------------------------
        // Is obj a Reference?
        // -----------------------------------------------------------------------
        if (!(obj instanceof Reference)) {
            return null;
        }

        Reference ref = (Reference) obj;

        // -----------------------------------------------------------------------
        // Is the right factory for this reference?
        // -----------------------------------------------------------------------
        if (!ivInstanceClassName.equals(ref.getFactoryClassName())) {
            return null;
        }

        // -----------------------------------------------------------------------
        // Is address null?
        // -----------------------------------------------------------------------
        RefAddr addr = ref.get(Addr_Type);
        if (addr == null) {
            NamingException nex = new NamingException("The address for this Reference is empty (null)");
            throw nex;
        }

        // -----------------------------------------------------------------------
        // Reference has the right factory and non empty address, so it is OK
        // to generate the EntityManager or EntityManagerFactory object now.
        // -----------------------------------------------------------------------

        Object retObj = null;

        JPAJndiLookupInfo info = (JPAJndiLookupInfo) addr.getContent();
        if (isTraceOn && tc.isDebugEnabled())
            Tr.debug(tc, "getting EntityManagerFactory for " + info);

        JPAPuId puId = info.getPuId(); // d424494
        J2EEName j2eeName = info.getJ2EEName(); // d510184
        String refName = info.getReferenceName(); // d510184
        boolean isSFSB = checkSFSBAccess(info, info.isSFSB()); // F743-30682
        JPAComponent jpaService = JPAAccessor.getJPAComponent();

        //Check to see see if we can delegate to the OSGi-aware JPA container
        JPALookupDelegate delegate = lookupDelegate.get();

        // If we find a delegate then call it to see if it can provide the Object
        if (delegate != null) {
            // Call the right method
            if (info.isFactory())
                retObj = delegate.getEntityManagerFactory(puId.getPuName(), j2eeName);
            else
                retObj = delegate.getEntityManager(puId.getPuName(), j2eeName, info.isExtendedContextType(), info.getPersistenceProperties());
        }

        if (retObj == null) {
            if (info.isFactory()) {
                retObj = jpaService.getEntityManagerFactory(puId,
                                                            j2eeName,
                                                            USE_EMF_PROXY_VALUE || isSFSB); // d706751
            } else {
                Map<?, ?> pCtxtProperties = info.getPersistenceProperties();
                retObj = jpaService.getEntityManager(puId,
                                                     j2eeName,
                                                     refName,
                                                     info.isExtendedContextType(),
                                                     info.isUnsynchronized(),
                                                     pCtxtProperties);

            }
        }

        return retObj;
    }
1203240
@Override
	public String getMessageToClient(String mfc) {
		HttpSession httpSession = iRSEndpoint.getHttpSession();
		String httpid = httpSession.getId();
		boolean monitored = monitorSessionManager.isMonitored(httpid);
		long t0 = 0;
		if(monitored) {
			t0 = System.currentTimeMillis();
		}
		String mtc = iRSEndpoint.getMessageToClient(mfc);
		if(monitored) {
			long t1 = System.currentTimeMillis();
			publish("request-event-"+httpid, mfc, mtc, t1 - t0);
		}
		return mtc;
	}
9709
@Override
    public Object getObject() throws RemoteObjectInstanceException {
        Object object;

        ClassLoader tccl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {

            @Override
            public ClassLoader run() {
                return Thread.currentThread().getContextClassLoader();
            }

        });

        try {
            Class<?> interfaceToNarrowTo = Class.forName(interfaceNameToNarrowTo, false, tccl);
            object = PortableRemoteObject.narrow(remoteObject, interfaceToNarrowTo);
        } catch (ClassNotFoundException ex) {
            throw new RemoteObjectInstanceException("Failed to find class " + interfaceNameToNarrowTo + " from classloader: " + tccl, ex);
        } catch (ClassCastException ex) {
            throw new RemoteObjectInstanceException("Unable to narrow remote object to " + interfaceNameToNarrowTo, ex);
        }

        return object;
    }
106826
def get(object_list)
      varbind_list = @mib.varbind_list(object_list, :NullValue)
      request = GetRequest.new(@@request_id.next, varbind_list)
      try_request(request)
    end
119639
private final Object getObject(String name)
   {
      Object result = m_map.get(name);
      return (result);
   }
883043
def get_object(self):
        
        obj = super(PublishActionView, self).get_object()

        if obj:
            if not hasattr(obj, 'publish'):
                raise http.Http404

        return obj
493507
@POST
	@Produces(MediaType.APPLICATION_JSON)
	@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
	@Override
	public String getMessageToClient(@FormParam(Constants.Message.MFC) String json) {
		HttpSession httpSession = getHttpSession();
		setContext(httpSession);
		MessageFromClient message = MessageFromClient.createFromJson(json);
		MessageToClient mtc = getMessageToClientService().createMessageToClient(message, httpSession);
		return mtc.toJson();
	}
968735
def simxGetObjectChild(clientID, parentObjectHandle, childIndex, operationMode):
    '''
    
    '''
    childObjectHandle = ct.c_int()
    return c_GetObjectChild(clientID, parentObjectHandle, childIndex, ct.byref(childObjectHandle), operationMode), childObjectHandle.value
1292571
public final Object getRealObject(Object objectOrProxy)
    {
        if(isNormalOjbProxy(objectOrProxy))
        {
            String msg;

            try
            {
                return getIndirectionHandler(objectOrProxy).getRealSubject();
            }
            catch(ClassCastException e)
            {
                // shouldn't happen but still ...
                msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler.class.getName();
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
            catch(IllegalArgumentException e)
            {
                msg = "Could not retrieve real object for given Proxy: " + objectOrProxy;
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
            catch(PersistenceBrokerException e)
            {
                log.error("Could not retrieve real object for given Proxy: " + objectOrProxy);
                throw e;
            }
        }
        else if(isVirtualOjbProxy(objectOrProxy))
        {
            try
            {
                return ((VirtualProxy) objectOrProxy).getRealSubject();
            }
            catch(PersistenceBrokerException e)
            {
                log.error("Could not retrieve real object for VirtualProxy: " + objectOrProxy);
                throw e;
            }
        }
        else
        {
            return objectOrProxy;
        }
    }
541811
def readObject(self):
        
        obj = pyamf.ASObject()
        self.context.addObject(obj)

        obj.update(self.readObjectAttributes(obj))

        return obj
752008
private void readObject(java.io.ObjectInputStream in)
                    throws IOException, ClassNotFoundException
    {
        in.defaultReadObject();

        byte[] tempEyeCatcher = new byte[Constants.EYE_CATCHER_LENGTH];

        // d164415 start
        int bytesRead = 0;
        for (int offset = 0; offset < Constants.EYE_CATCHER_LENGTH; offset += bytesRead)
        {
            bytesRead = in.read(tempEyeCatcher, offset, Constants.EYE_CATCHER_LENGTH - offset);
            if (bytesRead == -1)
            {
                throw new IOException("end of input stream while reading eye catcher");
            }
        } // d164415 end

        for (int i = 0; i < EYECATCHER.length; i++)
        {
            if (tempEyeCatcher[i] != EYECATCHER[i])
            {
                String eyeCatcherString = new String(tempEyeCatcher);
                throw new IOException("Invalid eye catcher '" + eyeCatcherString +
                                      "' in handle input stream");
            }
        }

        // Get websphere platform and version ID from header.
        in.readShort(); // platform
        ivActualVersion = in.readShort();
        //d158086 added version checking
        if ((ivActualVersion != Constants.HOME_HANDLE_V1) && (ivActualVersion != Constants.HOME_HANDLE_V2))
        {
            throw new java.io.InvalidObjectException("Home Handle data stream is not of the correct version, this client should be updated.");
        }
        //d158086

        // Use HandleDelegate object to read in EJBHome object.

        //d164668 allow 2nd change for type 1 home handles if stub doesn't connect use jndi logic

        try {
            ivEjbHome = HandleHelper.lookupHandleDelegate().readEJBHome(in);
        } catch (IOException ioe)
        {
            // FFDCFilter.processException(t, CLASS_NAME + "readObject", "335", this);

            if (ivActualVersion != Constants.HOME_HANDLE_V1)
            {
                throw ioe;
            }
        }

        if (ivActualVersion == Constants.HOME_HANDLE_V1)
        {
            ivInitialContextProperties = (Properties) in.readObject();
            ivHomeInterface = in.readUTF();
            ivJndiName = in.readUTF();

            // Null out the reference since we do not have a portable way
            // to determine if we got reference from the ORB and the version ID
            // indicates this is a non-robust  handle.  So, we need to force the
            // getEJBHome method to get a new reference by doing a JNDI lookup.
            ivEjbHome = null; //p125891
        }
    }
1357555
@Override
    public final Object get() {
        Object o = buffer.pop();

        if (beanPerf != null) { // Update PMI data
            beanPerf.objectRetrieve(buffer.size(), (o != null));
        }

        return o;
    }
953952
public Object getRemoteBusinessObject(int interfaceIndex)
                    throws RemoteException
    {
        Class<?>[] bInterfaceClasses = ivBMD.ivBusinessRemoteInterfaceClasses;
        BusinessRemoteWrapper wrapper = ivBusinessRemote[interfaceIndex];

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "getRemoteBusinessObject : " +
                         wrapper.getClass().getName());

        registerServant(wrapper, interfaceIndex);

        ClassLoader moduleContextClassLoader = ivBMD.ivContextClassLoader;
        Object result = getRemoteBusinessReference(wrapper, moduleContextClassLoader, bInterfaceClasses[interfaceIndex]);

        return result;
    }
1120814
def simxGetObjects(clientID, objectType, operationMode):
    '''
    
    '''

    objectCount = ct.c_int()
    objectHandles = ct.POINTER(ct.c_int)()

    ret = c_GetObjects(clientID, objectType, ct.byref(objectCount), ct.byref(objectHandles), operationMode)
    handles = []
    if ret == 0:
        for i in range(objectCount.value):
            handles.append(objectHandles[i])

    return ret, handles
1077765
@Override
  public I get()
  {
    I instance = _instance;
    
    if (instance == null || instance.isModified()) {
      _instance = instance = service().get();
    }
    
    return instance;
  }
650159
def get(self, objectType, *args, **coolArgs) :
		""""""
		
		ret = []
		for e in self._makeLoadQuery(objectType, *args, **coolArgs).iterRun() :
			if issubclass(objectType, pyGenoRabaObjectWrapper) :
				ret.append(objectType(wrapped_object_and_bag = (e, self.bagKey)))
			else :
				ret.append(e)

		return ret