Returns the captured state of the download; or null if it should not be
captured (for security reason).
165628
private PersistableDownload captureDownloadState(
            final GetObjectRequest getObjectRequest, final File file) {
        if (getObjectRequest.getSSECustomerKey() == null) {
            return new PersistableDownload(
                    getObjectRequest.getBucketName(), getObjectRequest.getKey(),
                    getObjectRequest.getVersionId(), getObjectRequest.getRange(),
                    getObjectRequest.getResponseHeaders(), getObjectRequest.isRequesterPays(),
                    file.getAbsolutePath(), getLastFullyDownloadedPartNumber(),
                    getObjectMetadata().getLastModified().getTime(),
                    getLastFullyDownloadedFilePosition());
        }
        return null;
    }
917023
protected Resource getDownloadResource() {

        String pathToDownload = (String)m_file.getValue();

        if (m_donwloadAll.getValue().booleanValue()) {
            pathToDownload = ZIP_PATH;
            writeZipFile();
        }

        final File downloadFile = new File(pathToDownload);

        return new StreamResource(new StreamResource.StreamSource() {

            private static final long serialVersionUID = -8868657402793427460L;

            public InputStream getStream() {

                try {
                    return new FileInputStream(downloadFile);
                } catch (FileNotFoundException e) {
                    return null;
                }

            }
        }, downloadFile.getName());
    }
1082714
public final String getState() {

        String thisMethodName = "getState";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, this);
            SibTr.exit(tc, thisMethodName, states[_state]);
        }

        return states[_state];
    }
1226053
private void downloadDataForStateHandle(
		Path restoreFilePath,
		StreamStateHandle remoteFileHandle,
		CloseableRegistry closeableRegistry) throws IOException {

		FSDataInputStream inputStream = null;
		FSDataOutputStream outputStream = null;

		try {
			FileSystem restoreFileSystem = restoreFilePath.getFileSystem();
			inputStream = remoteFileHandle.openInputStream();
			closeableRegistry.registerCloseable(inputStream);

			outputStream = restoreFileSystem.create(restoreFilePath, FileSystem.WriteMode.OVERWRITE);
			closeableRegistry.registerCloseable(outputStream);

			byte[] buffer = new byte[8 * 1024];
			while (true) {
				int numBytes = inputStream.read(buffer);
				if (numBytes == -1) {
					break;
				}

				outputStream.write(buffer, 0, numBytes);
			}
		} finally {
			if (closeableRegistry.unregisterCloseable(inputStream)) {
				inputStream.close();
			}

			if (closeableRegistry.unregisterCloseable(outputStream)) {
				outputStream.close();
			}
		}
	}
1251205
public com.google.protobuf.ByteString
      getStateBytes() {
    java.lang.Object ref = state_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      state_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
819515
public boolean getState()
    {
        boolean returnValue = true;
        if (m_objTarget instanceof String)
        {
            String fieldString = this.getString();
            returnValue = m_objTarget.equals(fieldString); // True if == target value
        }
        else
        {
            Object fieldString = this.getData();
            returnValue = m_objTarget.equals(fieldString); // True if == target value
        }
        if (m_bTrueIfMatch)
            return returnValue;
        else
            return !returnValue;
    }
172587
public @CheckForNull R get() {
        Holder<R> h = holder; // capture
        return h!=null ? h.get() : null;
    }
1343126
function getState (file) {
    // collect state for all possible data and recovery files
    var state = {};
    state.ephemeral = getFileInfo (file + ".eph");
    state.ready = getFileInfo (file + ".rdy");
    state.base = getFileInfo (file);
    state.backup = getFileInfo (file + ".bak");
    state.tertiary = getFileInfo (file + ".bk2");

    if (state.ephemeral.exists) {
        state.status = cc.SAFE_INTERVENE;
    } else if ((state.ready.exists) || (state.tertiary.exists)) {
        state.status = cc.SAFE_RECOVERABLE;
    } else if (state.base.exists) {
        state.status = cc.SAFE_NORMAL;
    } else {
        if (state.backup.exists) {
            state.status = cc.SAFE_RECOVERABLE;
        } else {
            state.status = cc.DOES_NOT_EXIST;
        }
    }

    return (state);
}
1074215
public String getState()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getState");
    String state = 
      messageProcessor.getDestinationManager().getDestinationIndex().getState(foreignDest).toString();
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "getState");
    return state;
  }
217855
DownloadState query(int downloadId) {
    synchronized (currentRequests) {
      for (DownloadRequest request : currentRequests) {
        if (request.downloadId() == downloadId) {
          return request.downloadState();
        }
      }
    }

    return DownloadState.INVALID;
  }
968847
@NullSafe
  public static Thread.State getState(Thread thread) {
    return (thread != null ? thread.getState() : null);
  }
383495
def get_state(self, force_update=False):
        
        if force_update or self._state is None:
            return int(self.basicevent.GetBinaryState()['BinaryState'])
        return self._state
178452
public List<DownloadHistoryItem> getDownloadHistory() {
        ClientResource resource = new ClientResource(Route.DOWNLOAD_HISTORY.url());
        resource.setChallengeResponse(this.auth.toChallenge());


        try {
            String result = resource.get().getText();
            return mapper.readValue(result, new TypeReference<List<DownloadHistoryItem>>() {});
        } catch (IOException e) {
            LEX4JLogger.log(Level.WARNING, "Could not retrieve download history correctly!");
            return null;
        }
    }
887727
def download(self, download_key, raise_exception_on_failure=False):
        """"""
        query = {"output": "json", "user_credentials": self.api_key}
        resp = requests.get(
            "%sdownload/%s" % (self._url, download_key),
            params=query,
            timeout=self._timeout,
        )

        if raise_exception_on_failure and resp.status_code != 200:
            raise DocumentDownloadFailure(resp.content, resp.status_code)
        return resp
142629
public boolean getState()
    {
        if (this.getData() == null)
            return m_bTrueIfNull;
        int fieldValue = (int)this.getValue();
        boolean returnValue = false;
        if ((fieldValue & (1 << m_iBitNumber)) != 0)
            returnValue = true;
        if (m_bTrueIfMatch)
            return returnValue;
        else
            return !returnValue;
    }
74717
@Nullable
    public String getState() {
        lifecycleLock.readLock().lock();
        try {
            return state == null ? null : state.toString();
        } finally {
            lifecycleLock.readLock().unlock();
        }
    }
976132
def get_state():
    
    sdp_state = SDPState()
    errval, errdict = _check_status(sdp_state)
    if errval == "error":
        LOG.debug(errdict['reason'])
        return dict(
            current_state="unknown",
            target_state="unknown",
            last_updated="unknown",
            reason=errdict['reason']
        )
    _last_updated = sdp_state.current_timestamp
    if sdp_state.target_timestamp > _last_updated:
        _last_updated = sdp_state.target_timestamp

    return dict(
        current_state=sdp_state.current_state,
        target_state=sdp_state.target_state,
        allowed_target_states=sdp_state.allowed_target_states[
            sdp_state.current_state],
        last_updated=_last_updated.isoformat()
    ), HTTPStatus.OK