_id
stringlengths
2
7
title
stringlengths
3
140
partition
stringclasses
3 values
text
stringlengths
73
34.1k
language
stringclasses
1 value
meta_information
dict
q167800
TableServiceEntity.setReflectedEntityCacheDisabled
validation
public static void setReflectedEntityCacheDisabled(boolean disableReflectedEntityCache) { if (TableServiceEntity.reflectedEntityCache != null && disableReflectedEntityCache) { TableServiceEntity.reflectedEntityCache.clear(); } TableServiceEntity.disableReflectedEntityCache = disable...
java
{ "resource": "" }
q167801
BaseResponse.getDate
validation
public static String getDate(final HttpURLConnection request) { final String retString = request.getHeaderField("Date"); return retString == null ? request.getHeaderField(Constants.HeaderConstants.DATE) : retString; }
java
{ "resource": "" }
q167802
BaseResponse.getMetadata
validation
public static HashMap<String, String> getMetadata(final HttpURLConnection request) { return getValuesByHeaderPrefix(request, Constants.HeaderConstants.PREFIX_FOR_STORAGE_METADATA); }
java
{ "resource": "" }
q167803
BaseResponse.isServerRequestEncrypted
validation
public static boolean isServerRequestEncrypted(HttpURLConnection request) { return Constants.TRUE.equals(request.getHeaderField(Constants.HeaderConstants.SERVER_REQUEST_ENCRYPTED)); }
java
{ "resource": "" }
q167804
TableStorageErrorDeserializer.getExtendedErrorInformation
validation
public static StorageExtendedErrorInformation getExtendedErrorInformation(final Reader reader, final TablePayloadFormat format) throws JsonParseException, IOException { JsonFactory jsonFactory = new JsonFactory(); JsonParser parser = jsonFactory.createParser(reader); try { ...
java
{ "resource": "" }
q167805
TableStorageErrorDeserializer.parseErrorDetails
validation
public static StorageExtendedErrorInformation parseErrorDetails(StorageRequest<CloudTableClient, ?, ?> request) { try { if (request == null || request.getConnection().getErrorStream() == null) { return null; } return getExtendedErrorInformation(new InputS...
java
{ "resource": "" }
q167806
TableStorageErrorDeserializer.parseJsonErrorException
validation
private static HashMap<String, String[]> parseJsonErrorException(JsonParser parser) throws JsonParseException, IOException { HashMap<String, String[]> additionalDetails = new HashMap<String, String[]>(); parser.nextToken(); JsonUtilities.assertIsStartObjectJsonToken(parser); ...
java
{ "resource": "" }
q167807
SharedAccessPolicyHandler.getAccessIdentifiers
validation
public static <T extends SharedAccessPolicy> HashMap<String, T> getAccessIdentifiers(final InputStream stream, final Class<T> cls) throws ParserConfigurationException, SAXException, IOException { SAXParser saxParser = Utility.getSAXParser(); SharedAccessPolicyHandler<T> handler = new SharedA...
java
{ "resource": "" }
q167808
FileResponse.getCopyState
validation
public static CopyState getCopyState(final HttpURLConnection request) throws URISyntaxException, ParseException { String copyStatusString = request.getHeaderField(Constants.HeaderConstants.COPY_STATUS); if (!Utility.isNullOrEmpty(copyStatusString)) { final CopyState copyState = new CopyState...
java
{ "resource": "" }
q167809
FileResponse.getFileShareAttributes
validation
public static FileShareAttributes getFileShareAttributes(final HttpURLConnection request, final boolean usePathStyleUris) throws StorageException { final FileShareAttributes shareAttributes = new FileShareAttributes(); final FileShareProperties shareProperties = shareAttributes.getProperties...
java
{ "resource": "" }
q167810
FileResponse.getFileDirectoryAttributes
validation
public static FileDirectoryAttributes getFileDirectoryAttributes(final HttpURLConnection request, final boolean usePathStyleUris) throws StorageException { final FileDirectoryAttributes directoryAttributes = new FileDirectoryAttributes(); URI tempURI; try { tempURI = Path...
java
{ "resource": "" }
q167811
FileResponse.getFileAttributes
validation
public static FileAttributes getFileAttributes(final HttpURLConnection request, final StorageUri resourceURI) throws URISyntaxException, ParseException { final FileAttributes fileAttributes = new FileAttributes(); final FileProperties properties = fileAttributes.getProperties(); pro...
java
{ "resource": "" }
q167812
MimePart.getHttpVerbForOperation
validation
static String getHttpVerbForOperation(final TableOperationType operationType) { if (operationType == TableOperationType.INSERT) { return "POST"; } else if (operationType == TableOperationType.DELETE) { return "DELETE"; } else if (operationType == TableOper...
java
{ "resource": "" }
q167813
StorageEventMultiCaster.fireEvent
validation
public void fireEvent(final EVENT_TYPE event) { for (final StorageEvent<EVENT_TYPE> listener : this.listeners) { listener.eventOccurred(event); } }
java
{ "resource": "" }
q167814
ExecutionEngine.fireSendingRequestEvent
validation
private static void fireSendingRequestEvent(OperationContext opContext, HttpURLConnection request, RequestResult result) { if (opContext.getSendingRequestEventHandler().hasListeners() || OperationContext.getGlobalSendingRequestEventHandler().hasListeners()) { SendingReque...
java
{ "resource": "" }
q167815
ExecutionEngine.fireResponseReceivedEvent
validation
private static void fireResponseReceivedEvent(OperationContext opContext, HttpURLConnection request, RequestResult result) { if (opContext.getResponseReceivedEventHandler().hasListeners() || OperationContext.getGlobalResponseReceivedEventHandler().hasListeners()) { Respon...
java
{ "resource": "" }
q167816
ExecutionEngine.fireErrorReceivingResponseEvent
validation
private static void fireErrorReceivingResponseEvent(OperationContext opContext, HttpURLConnection request, RequestResult result) { if (opContext.getErrorReceivingResponseEventHandler().hasListeners() || OperationContext.getGlobalErrorReceivingResponseEventHandler().hasListeners()) { ...
java
{ "resource": "" }
q167817
ExecutionEngine.fireRequestCompletedEvent
validation
private static void fireRequestCompletedEvent(OperationContext opContext, HttpURLConnection request, RequestResult result) { if (opContext.getRequestCompletedEventHandler().hasListeners() || OperationContext.getGlobalRequestCompletedEventHandler().hasListeners()) { Reques...
java
{ "resource": "" }
q167818
ExecutionEngine.fireRetryingEvent
validation
private static void fireRetryingEvent(OperationContext opContext, HttpURLConnection request, RequestResult result, RetryContext retryContext) { if (opContext.getRetryingEventHandler().hasListeners() || OperationContext.getGlobalRetryingEventHandler().hasListeners()) { Ret...
java
{ "resource": "" }
q167819
Utility.assertContinuationType
validation
public static void assertContinuationType(final ResultContinuation continuationToken, final ResultContinuationType continuationType) { if (continuationToken != null) { if (!(continuationToken.getContinuationType() == ResultContinuationType.NONE || continuationToken .g...
java
{ "resource": "" }
q167820
Utility.assertInBounds
validation
public static void assertInBounds(final String param, final long value, final long min, final long max) { if (value < min || value > max) { throw new IllegalArgumentException(String.format(SR.PARAMETER_NOT_IN_RANGE, param, min, max)); } }
java
{ "resource": "" }
q167821
Utility.assertGreaterThanOrEqual
validation
public static void assertGreaterThanOrEqual(final String param, final long value, final long min) { if (value < min) { throw new IllegalArgumentException(String.format(SR.PARAMETER_SHOULD_BE_GREATER_OR_EQUAL, param, min)); } }
java
{ "resource": "" }
q167822
Utility.validateMaxExecutionTimeout
validation
public static boolean validateMaxExecutionTimeout(Long operationExpiryTimeInMs, long additionalInterval) { if (operationExpiryTimeInMs != null) { long currentTime = new Date().getTime(); return operationExpiryTimeInMs < currentTime + additionalInterval; } return false; ...
java
{ "resource": "" }
q167823
Utility.getRemainingTimeout
validation
public static int getRemainingTimeout(Long operationExpiryTimeInMs, Integer timeoutIntervalInMs) throws StorageException { if (operationExpiryTimeInMs != null) { long remainingTime = operationExpiryTimeInMs - new Date().getTime(); if (remainingTime > Integer.MAX_VALUE) { ...
java
{ "resource": "" }
q167824
Utility.determinePathStyleFromUri
validation
public static boolean determinePathStyleFromUri(final URI baseURI) { String path = baseURI.getPath(); if (path != null && path.startsWith("/")) { path = path.substring(1); } // if the path is null or empty, this is not path-style if (Utility.isNullOrEmpty(path)) { ...
java
{ "resource": "" }
q167825
Utility.isHostDnsName
validation
private static boolean isHostDnsName(URI uri) { String host = uri.getHost(); for (int i = 0; i < host.length(); i++) { char hostChar = host.charAt(i); if (!Character.isDigit(hostChar) && !(hostChar == '.')) { return true; } } return fal...
java
{ "resource": "" }
q167826
Utility.formatETag
validation
public static String formatETag(final String etag) { if (etag.startsWith("\"") && etag.endsWith("\"")) { return etag; } else { return String.format("\"%s\"", etag); } }
java
{ "resource": "" }
q167827
Utility.generateNewUnexpectedStorageException
validation
public static StorageException generateNewUnexpectedStorageException(final Exception cause) { final StorageException exceptionRef = new StorageException(StorageErrorCode.NONE.toString(), "Unexpected internal storage client error.", 306, // unused null, null); exceptionRef...
java
{ "resource": "" }
q167828
Utility.getStandardHeaderValue
validation
public static String getStandardHeaderValue(final HttpURLConnection conn, final String headerName) { final String headerValue = conn.getRequestProperty(headerName); // Coalesce null value return headerValue == null ? Constants.EMPTY_STRING : headerValue; }
java
{ "resource": "" }
q167829
Utility.parseDateFromString
validation
public static Date parseDateFromString(final String value, final String pattern, final TimeZone timeZone) throws ParseException { final DateFormat rfc1123Format = new SimpleDateFormat(pattern, Utility.LOCALE_US); rfc1123Format.setTimeZone(timeZone); return rfc1123Format.parse(value);...
java
{ "resource": "" }
q167830
Utility.parseRFC1123DateFromStringInGMT
validation
public static Date parseRFC1123DateFromStringInGMT(final String value) throws ParseException { final DateFormat format = new SimpleDateFormat(RFC1123_GMT_PATTERN, Utility.LOCALE_US); format.setTimeZone(GMT_ZONE); return format.parse(value); }
java
{ "resource": "" }
q167831
Utility.safeRelativize
validation
public static String safeRelativize(final URI baseURI, final URI toUri) throws URISyntaxException { // For compatibility followed // http://msdn.microsoft.com/en-us/library/system.uri.makerelativeuri.aspx // if host and scheme are not identical return from uri if (!baseURI.getHost().equ...
java
{ "resource": "" }
q167832
Utility.logHttpError
validation
public static void logHttpError(StorageException ex, OperationContext opContext) { if (Logger.shouldLog(opContext, Log.DEBUG)) { try { StringBuilder bld = new StringBuilder(); bld.append("Error response received. "); bld.append("HttpStatusCode= ")...
java
{ "resource": "" }
q167833
Utility.logHttpResponse
validation
public static void logHttpResponse(HttpURLConnection conn, OperationContext opContext) throws IOException { if (Logger.shouldLog(opContext, Log.VERBOSE)) { try { StringBuilder bld = new StringBuilder(); // This map's null key will contain the response code and me...
java
{ "resource": "" }
q167834
Utility.trimEnd
validation
protected static String trimEnd(final String value, final char trimChar) { int stopDex = value.length() - 1; while (stopDex > 0 && value.charAt(stopDex) == trimChar) { stopDex--; } return stopDex == value.length() - 1 ? value : value.substring(stopDex); }
java
{ "resource": "" }
q167835
Utility.trimStart
validation
public static String trimStart(final String value) { int spaceDex = 0; while (spaceDex < value.length() && value.charAt(spaceDex) == ' ') { spaceDex++; } return value.substring(spaceDex); }
java
{ "resource": "" }
q167836
Utility.parseDate
validation
public static Date parseDate(String dateString) { String pattern = MAX_PRECISION_PATTERN; switch(dateString.length()) { case 28: // "yyyy-MM-dd'T'HH:mm:ss.SSSSSSS'Z'"-> [2012-01-04T23:21:59.1234567Z] length = 28 case 27: // "yyyy-MM-dd'T'HH:mm:ss.SSSSSS'Z'"-> [2012-01-04T23:21:59...
java
{ "resource": "" }
q167837
Utility.getListingLocationMode
validation
public static RequestLocationMode getListingLocationMode(ResultContinuation token) { if ((token != null) && token.getTargetLocation() != null) { switch (token.getTargetLocation()) { case PRIMARY: return RequestLocationMode.PRIMARY_ONLY; case SECON...
java
{ "resource": "" }
q167838
QueueRequestOptions.populateAndApplyDefaults
validation
protected static final QueueRequestOptions populateAndApplyDefaults(QueueRequestOptions options, final CloudQueueClient client) { QueueRequestOptions modifiedOptions = new QueueRequestOptions(options); RequestOptions.populateRequestOptions(modifiedOptions, client.getDefaultRequestOptions(), true /* setS...
java
{ "resource": "" }
q167839
LogRecordStreamReader.readString
validation
public String readString() throws IOException { String temp = this.readField(false /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return temp; } }
java
{ "resource": "" }
q167840
LogRecordStreamReader.readQuotedString
validation
public String readQuotedString() throws IOException { String temp = this.readField(true /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return temp; } }
java
{ "resource": "" }
q167841
LogRecordStreamReader.readBoolean
validation
public Boolean readBoolean() throws IOException { String temp = this.readField(false /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return Boolean.parseBoolean(temp); } }
java
{ "resource": "" }
q167842
LogRecordStreamReader.readDate
validation
public Date readDate(DateFormat format) throws IOException, ParseException { String temp = this.readField(false /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return format.parse(temp); } }
java
{ "resource": "" }
q167843
LogRecordStreamReader.readDouble
validation
public Double readDouble() throws IOException { String temp = this.readField(false /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return Double.parseDouble(temp); } }
java
{ "resource": "" }
q167844
LogRecordStreamReader.readUuid
validation
public UUID readUuid() throws IOException { String temp = this.readField(false /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return UUID.fromString(temp); } }
java
{ "resource": "" }
q167845
LogRecordStreamReader.readInteger
validation
public Integer readInteger() throws IOException { String temp = this.readField(false /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return Integer.parseInt(temp); } }
java
{ "resource": "" }
q167846
LogRecordStreamReader.readLong
validation
public Long readLong() throws IOException { String temp = this.readField(false /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return Long.parseLong(temp); } }
java
{ "resource": "" }
q167847
LogRecordStreamReader.readUri
validation
public URI readUri() throws URISyntaxException, IOException { String temp = this.readField(true /* isQuotedString */); if (Utility.isNullOrEmpty(temp)) { return null; } else { return new URI(Html.fromHtml(temp).toString()); } }
java
{ "resource": "" }
q167848
LogRecordStreamReader.readDelimiter
validation
private void readDelimiter(char delimiter) throws IOException { if (this.isEndOfFile()) { throw new EOFException(SR.LOG_STREAM_END_ERROR); } else { int read = this.read(); if (read == -1 || (char) read != delimiter) { throw new IllegalStateExce...
java
{ "resource": "" }
q167849
LogRecordStreamReader.tryPeekDelimiter
validation
private boolean tryPeekDelimiter(char delimiter) throws IOException { if (this.isEndOfFile()) { throw new EOFException(SR.LOG_STREAM_END_ERROR); } else { if ((char) this.peek() != delimiter) { return false; } else { ...
java
{ "resource": "" }
q167850
LogRecordStreamReader.readField
validation
private String readField(boolean isQuotedString) throws IOException { if (!this.isFirstFieldInRecord) { this.readDelimiter(LogRecordStreamReader.FIELD_DELIMITER); } else { this.isFirstFieldInRecord = false; } // Read a field, handling field/record delimit...
java
{ "resource": "" }
q167851
RetryExponentialRetry.createInstance
validation
@Override public RetryPolicy createInstance(final OperationContext opContext) { return new RetryExponentialRetry(this.resolvedMinBackoff, this.deltaBackoffIntervalInMs, this.resolvedMaxBackoff, this.maximumAttempts); }
java
{ "resource": "" }
q167852
LazySegmentedIterator.hasNext
validation
@Override @DoesServiceRequest public boolean hasNext() { while (this.currentSegment == null || (!this.currentSegmentIterator.hasNext() && this.currentSegment != null && this.currentSegment .getHasMoreResults())) { try { this.currentSegm...
java
{ "resource": "" }
q167853
QueryTableOperation.setClazzType
validation
protected void setClazzType(final Class<? extends TableEntity> clazzType) { Utility.assertNotNull("clazzType", clazzType); Utility.checkNullaryCtor(clazzType); this.clazzType = clazzType; }
java
{ "resource": "" }
q167854
QueryTableOperation.setResolver
validation
protected void setResolver(final EntityResolver<?> resolver) { Utility.assertNotNull(SR.QUERY_REQUIRES_VALID_CLASSTYPE_OR_RESOLVER, resolver); this.resolver = resolver; }
java
{ "resource": "" }
q167855
MimeHelper.writeMIMEBoundary
validation
private static void writeMIMEBoundary(final OutputStreamWriter outWriter, final String boundaryID) throws IOException { outWriter.write(String.format("--%s\r\n", boundaryID)); }
java
{ "resource": "" }
q167856
MimeHelper.writeMIMEBoundaryClosure
validation
private static void writeMIMEBoundaryClosure(final OutputStreamWriter outWriter, final String boundaryID) throws IOException { outWriter.write(String.format("--%s--\r\n", boundaryID)); }
java
{ "resource": "" }
q167857
MimeHelper.writeMIMEContentType
validation
private static void writeMIMEContentType(final OutputStreamWriter outWriter, final String boundaryName) throws IOException { outWriter.write(String.format("Content-Type: multipart/mixed; boundary=%s\r\n", boundaryName)); }
java
{ "resource": "" }
q167858
UriQueryBuilder.add
validation
public void add(final String name, final String value) throws StorageException { if (Utility.isNullOrEmpty(name)) { throw new IllegalArgumentException(SR.QUERY_PARAMETER_NULL_OR_EMPTY); } this.insertKeyValue(name, value); }
java
{ "resource": "" }
q167859
UriQueryBuilder.addToURI
validation
public URI addToURI(final URI uri) throws URISyntaxException, StorageException { final String origRawQuery = uri.getRawQuery(); final String rawFragment = uri.getRawFragment(); final String uriString = uri.resolve(uri).toASCIIString(); final HashMap<String, String[]> origQueryMap = Path...
java
{ "resource": "" }
q167860
BaseRequest.addOptionalHeader
validation
public static void addOptionalHeader(final HttpURLConnection request, final String name, final String value) { if (value != null && !value.equals(Constants.EMPTY_STRING)) { request.setRequestProperty(name, value); } }
java
{ "resource": "" }
q167861
BaseRequest.createURLConnection
validation
public static HttpURLConnection createURLConnection(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); ...
java
{ "resource": "" }
q167862
BaseRequest.delete
validation
public static HttpURLConnection delete(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); } final HttpU...
java
{ "resource": "" }
q167863
BaseRequest.getServiceProperties
validation
public static HttpURLConnection getServiceProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); ...
java
{ "resource": "" }
q167864
BaseRequest.getUserAgent
validation
public static String getUserAgent() { if (userAgent == null) { String userAgentComment = String.format(Utility.LOCALE_US, "(Android %s; %s; %s)", android.os.Build.VERSION.RELEASE, android.os.Build.BRAND, android.os.Build.MODEL); userAgent = String.format("%s/%s %s", C...
java
{ "resource": "" }
q167865
BaseRequest.setMetadata
validation
public static HttpURLConnection setMetadata(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); } build...
java
{ "resource": "" }
q167866
BaseRequest.setServiceProperties
validation
public static HttpURLConnection setServiceProperties(final URI uri, final RequestOptions options, UriQueryBuilder builder, final OperationContext opContext) throws IOException, URISyntaxException, StorageException { if (builder == null) { builder = new UriQueryBuilder(); ...
java
{ "resource": "" }
q167867
FileOutputStream.close
validation
@Override @DoesServiceRequest public void close() throws IOException { try { // if the user has already closed the stream, this will throw a STREAM_CLOSED exception // if an exception was thrown by any thread in the threadExecutor, realize it now this.checkStreamState...
java
{ "resource": "" }
q167868
FileOutputStream.commit
validation
@DoesServiceRequest private void commit() throws StorageException, URISyntaxException { if (this.options.getStoreFileContentMD5()) { this.parentFileRef.getProperties().setContentMD5(Base64.encode(this.md5Digest.digest())); } this.parentFileRef.uploadProperties(this.accessConditi...
java
{ "resource": "" }
q167869
FileOutputStream.dispatchWrite
validation
@DoesServiceRequest private synchronized void dispatchWrite(final int writeLength) throws IOException { if (writeLength == 0) { return; } Callable<Void> worker = null; if (this.outstandingRequests > this.options.getConcurrentRequestCount() * 2) { this.waitFo...
java
{ "resource": "" }
q167870
FileOutputStream.flush
validation
@Override @DoesServiceRequest public synchronized void flush() throws IOException { this.checkStreamState(); // Dispatch a write for the current bytes in the buffer this.dispatchWrite(this.currentBufferedBytes); // Waits for all submitted tasks to complete ...
java
{ "resource": "" }
q167871
FileOutputStream.waitForTaskToComplete
validation
private void waitForTaskToComplete() throws IOException { try { final Future<Void> future = this.completionService.take(); future.get(); } catch (final InterruptedException e) { throw Utility.initIOException(e); } catch (final ExecutionExceptio...
java
{ "resource": "" }
q167872
FileOutputStream.write
validation
@Override @DoesServiceRequest public void write(final byte[] data, final int offset, final int length) throws IOException { if (offset < 0 || length < 0 || length > data.length - offset) { throw new IndexOutOfBoundsException(); } this.writeInternal(data, offset, length); ...
java
{ "resource": "" }
q167873
FileOutputStream.write
validation
@DoesServiceRequest public void write(final InputStream sourceStream, final long writeLength) throws IOException, StorageException { Utility.writeToOutputStream(sourceStream, this, writeLength, false, false, this.opContext, this.options, false); }
java
{ "resource": "" }
q167874
FileOutputStream.writeInternal
validation
@DoesServiceRequest private synchronized void writeInternal(final byte[] data, int offset, int length) throws IOException { while (length > 0) { this.checkStreamState(); final int availableBufferBytes = this.internalWriteThreshold - this.currentBufferedBytes; final int n...
java
{ "resource": "" }
q167875
CloudStorageAccount.getDNS
validation
private static String getDNS(String service, String base) { if (base == null) { base = DEFAULT_DNS; } return String.format(DNS_NAME_FORMAT, service, base); }
java
{ "resource": "" }
q167876
CloudStorageAccount.tryConfigureDevStore
validation
private static CloudStorageAccount tryConfigureDevStore(final Map<String, String> settings) throws URISyntaxException { if (matchesSpecification( settings, allRequired(USE_DEVELOPMENT_STORAGE_NAME), optional(DEVELOPMENT_STORAGE_PROXY_URI_NAME))) { ...
java
{ "resource": "" }
q167877
CloudStorageAccount.tryConfigureServiceAccount
validation
private static CloudStorageAccount tryConfigureServiceAccount(final Map<String, String> settings) throws URISyntaxException, InvalidKeyException { ConnectionStringFilter endpointsOptional = optional( BLOB_ENDPOINT_NAME, BLOB_SECONDARY_ENDPOINT_NAME, ...
java
{ "resource": "" }
q167878
CloudStorageAccount.createCloudAnalyticsClient
validation
public CloudAnalyticsClient createCloudAnalyticsClient() { if (this.getBlobStorageUri() == null) { throw new IllegalArgumentException(SR.BLOB_ENDPOINT_NOT_CONFIGURED); } if (this.getTableStorageUri() == null) { throw new IllegalArgumentException(SR.TABLE_ENDPOINT_NOT_CON...
java
{ "resource": "" }
q167879
CloudStorageAccount.createCloudBlobClient
validation
public CloudBlobClient createCloudBlobClient() { if (this.getBlobStorageUri() == null) { throw new IllegalArgumentException(SR.BLOB_ENDPOINT_NOT_CONFIGURED); } if (this.credentials == null) { throw new IllegalArgumentException(SR.MISSING_CREDENTIALS); } ...
java
{ "resource": "" }
q167880
CloudStorageAccount.createCloudFileClient
validation
public CloudFileClient createCloudFileClient() { if (this.getFileStorageUri() == null) { throw new IllegalArgumentException(SR.FILE_ENDPOINT_NOT_CONFIGURED); } if (this.credentials == null) { throw new IllegalArgumentException(SR.MISSING_CREDENTIALS); } ...
java
{ "resource": "" }
q167881
CloudStorageAccount.createCloudQueueClient
validation
public CloudQueueClient createCloudQueueClient() { if (this.getQueueStorageUri() == null) { throw new IllegalArgumentException(SR.QUEUE_ENDPOINT_NOT_CONFIGURED); } if (this.credentials == null) { throw new IllegalArgumentException(SR.MISSING_CREDENTIALS); } ...
java
{ "resource": "" }
q167882
CloudStorageAccount.createCloudTableClient
validation
public CloudTableClient createCloudTableClient() { if (this.getTableStorageUri() == null) { throw new IllegalArgumentException(SR.TABLE_ENDPOINT_NOT_CONFIGURED); } if (this.credentials == null) { throw new IllegalArgumentException(SR.MISSING_CREDENTIALS); } ...
java
{ "resource": "" }
q167883
CloudStorageAccount.generateSharedAccessSignature
validation
public String generateSharedAccessSignature(SharedAccessAccountPolicy policy) throws InvalidKeyException, StorageException { if (!StorageCredentialsHelper.canCredentialsSignRequest(this.getCredentials())) { throw new IllegalArgumentException(SR.CANNOT_CREATE_SAS_WITHOUT_ACCOUNT_KEY); ...
java
{ "resource": "" }
q167884
TableOperation.generateRequestIdentity
validation
protected String generateRequestIdentity(boolean isSingleIndexEntry, final String entryName) throws StorageException { if (isSingleIndexEntry) { return String.format("'%s'", entryName.replace("'", "''")); } if (this.opType == TableOperationType.INSERT) { retu...
java
{ "resource": "" }
q167885
TableOperation.generateRequestIdentityWithTable
validation
protected String generateRequestIdentityWithTable(final String tableName) throws StorageException { return String.format("%s(%s)", tableName, generateRequestIdentity(false, null)); }
java
{ "resource": "" }
q167886
StorageRequest.initialize
validation
protected final void initialize(OperationContext opContext) { RequestResult currResult = new RequestResult(); this.setResult(currResult); opContext.appendRequestResult(currResult); this.setException(null); this.setNonExceptionedRetryableFailure(false); this.setIsSent(fal...
java
{ "resource": "" }
q167887
StorageRequest.materializeException
validation
protected final StorageException materializeException(final OperationContext opContext) { if (this.getException() != null) { return this.getException(); } return StorageException.translateException(this, null, opContext); }
java
{ "resource": "" }
q167888
StorageRequest.postProcessResponse
validation
public R postProcessResponse(HttpURLConnection connection, P parentObject, C client, OperationContext context, R storageObject) throws Exception { return storageObject; }
java
{ "resource": "" }
q167889
StorageRequest.parseErrorDetails
validation
public StorageExtendedErrorInformation parseErrorDetails() { try { if (this.getConnection() == null || this.getConnection().getErrorStream() == null) { return null; } return StorageErrorHandler.getExtendedErrorInformation(this.getConnection().getErrorStream()...
java
{ "resource": "" }
q167890
TableBatchOperation.delete
validation
public void delete(final TableEntity entity) { this.lockToPartitionKey(entity.getPartitionKey()); this.add(TableOperation.delete(entity)); }
java
{ "resource": "" }
q167891
TableBatchOperation.insert
validation
public void insert(final TableEntity entity, boolean echoContent) { this.lockToPartitionKey(entity.getPartitionKey()); this.add(TableOperation.insert(entity, echoContent)); }
java
{ "resource": "" }
q167892
TableBatchOperation.insertOrMerge
validation
public void insertOrMerge(final TableEntity entity) { this.lockToPartitionKey(entity.getPartitionKey()); this.add(TableOperation.insertOrMerge(entity)); }
java
{ "resource": "" }
q167893
TableBatchOperation.insertOrReplace
validation
public void insertOrReplace(final TableEntity entity) { this.lockToPartitionKey(entity.getPartitionKey()); this.add(TableOperation.insertOrReplace(entity)); }
java
{ "resource": "" }
q167894
TableBatchOperation.merge
validation
public void merge(final TableEntity entity) { this.lockToPartitionKey(entity.getPartitionKey()); this.add(TableOperation.merge(entity)); }
java
{ "resource": "" }
q167895
TableBatchOperation.remove
validation
@Override public TableOperation remove(int index) { TableOperation op = super.remove(index); checkResetEntityLocks(); return op; }
java
{ "resource": "" }
q167896
TableBatchOperation.removeAll
validation
@Override public boolean removeAll(java.util.Collection<?> c) { boolean ret = super.removeAll(c); checkResetEntityLocks(); return ret; }
java
{ "resource": "" }
q167897
TableBatchOperation.replace
validation
public void replace(final TableEntity entity) { this.lockToPartitionKey(entity.getPartitionKey()); this.add(TableOperation.replace(entity)); }
java
{ "resource": "" }
q167898
TableBatchOperation.checkSingleQueryPerBatch
validation
private void checkSingleQueryPerBatch(final TableOperation op, final int size) { // if this has a query then no other operations can be added. if (this.hasQuery) { throw new IllegalArgumentException(SR.RETRIEVE_MUST_BE_ONLY_OPERATION_IN_BATCH); } if (op.getOperationType() ==...
java
{ "resource": "" }
q167899
TableBatchOperation.lockToPartitionKey
validation
private void lockToPartitionKey(final String partitionKey) { if (this.partitionKey == null) { this.partitionKey = partitionKey; } else { if (partitionKey.length() != partitionKey.length() || !this.partitionKey.equals(partitionKey)) { throw new IllegalArgum...
java
{ "resource": "" }