id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
111,800 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.link | public void link(JimfsPath link, FileSystemView existingView, JimfsPath existing)
throws IOException {
checkNotNull(link);
checkNotNull(existingView);
checkNotNull(existing);
if (!store.supportsFeature(Feature.LINKS)) {
throw new UnsupportedOperationException();
}
if (!isSameFileSy... | java | public void link(JimfsPath link, FileSystemView existingView, JimfsPath existing)
throws IOException {
checkNotNull(link);
checkNotNull(existingView);
checkNotNull(existing);
if (!store.supportsFeature(Feature.LINKS)) {
throw new UnsupportedOperationException();
}
if (!isSameFileSy... | [
"public",
"void",
"link",
"(",
"JimfsPath",
"link",
",",
"FileSystemView",
"existingView",
",",
"JimfsPath",
"existing",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"link",
")",
";",
"checkNotNull",
"(",
"existingView",
")",
";",
"checkNotNull",
"(",... | Creates a hard link at the given link path to the regular file at the given path. The existing
file must exist and must be a regular file. The given file system view must belong to the same
file system as this view. | [
"Creates",
"a",
"hard",
"link",
"at",
"the",
"given",
"link",
"path",
"to",
"the",
"regular",
"file",
"at",
"the",
"given",
"path",
".",
"The",
"existing",
"file",
"must",
"exist",
"and",
"must",
"be",
"a",
"regular",
"file",
".",
"The",
"given",
"file... | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L392-L430 |
111,801 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.deleteFile | public void deleteFile(JimfsPath path, DeleteMode deleteMode) throws IOException {
store.writeLock().lock();
try {
DirectoryEntry entry = lookUp(path, Options.NOFOLLOW_LINKS).requireExists(path);
delete(entry, deleteMode, path);
} finally {
store.writeLock().unlock();
}
} | java | public void deleteFile(JimfsPath path, DeleteMode deleteMode) throws IOException {
store.writeLock().lock();
try {
DirectoryEntry entry = lookUp(path, Options.NOFOLLOW_LINKS).requireExists(path);
delete(entry, deleteMode, path);
} finally {
store.writeLock().unlock();
}
} | [
"public",
"void",
"deleteFile",
"(",
"JimfsPath",
"path",
",",
"DeleteMode",
"deleteMode",
")",
"throws",
"IOException",
"{",
"store",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"DirectoryEntry",
"entry",
"=",
"lookUp",
"(",
"path"... | Deletes the file at the given absolute path. | [
"Deletes",
"the",
"file",
"at",
"the",
"given",
"absolute",
"path",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L433-L441 |
111,802 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.delete | private void delete(DirectoryEntry entry, DeleteMode deleteMode, JimfsPath pathForException)
throws IOException {
Directory parent = entry.directory();
File file = entry.file();
checkDeletable(file, deleteMode, pathForException);
parent.unlink(entry.name());
parent.updateModifiedTime();
... | java | private void delete(DirectoryEntry entry, DeleteMode deleteMode, JimfsPath pathForException)
throws IOException {
Directory parent = entry.directory();
File file = entry.file();
checkDeletable(file, deleteMode, pathForException);
parent.unlink(entry.name());
parent.updateModifiedTime();
... | [
"private",
"void",
"delete",
"(",
"DirectoryEntry",
"entry",
",",
"DeleteMode",
"deleteMode",
",",
"JimfsPath",
"pathForException",
")",
"throws",
"IOException",
"{",
"Directory",
"parent",
"=",
"entry",
".",
"directory",
"(",
")",
";",
"File",
"file",
"=",
"e... | Deletes the given directory entry from its parent directory. | [
"Deletes",
"the",
"given",
"directory",
"entry",
"from",
"its",
"parent",
"directory",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L444-L454 |
111,803 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.checkDeletable | private void checkDeletable(File file, DeleteMode mode, Path path) throws IOException {
if (file.isRootDirectory()) {
throw new FileSystemException(path.toString(), null, "can't delete root directory");
}
if (file.isDirectory()) {
if (mode == DeleteMode.NON_DIRECTORY_ONLY) {
throw new F... | java | private void checkDeletable(File file, DeleteMode mode, Path path) throws IOException {
if (file.isRootDirectory()) {
throw new FileSystemException(path.toString(), null, "can't delete root directory");
}
if (file.isDirectory()) {
if (mode == DeleteMode.NON_DIRECTORY_ONLY) {
throw new F... | [
"private",
"void",
"checkDeletable",
"(",
"File",
"file",
",",
"DeleteMode",
"mode",
",",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"file",
".",
"isRootDirectory",
"(",
")",
")",
"{",
"throw",
"new",
"FileSystemException",
"(",
"path",
... | Checks that the given file can be deleted, throwing an exception if it can't. | [
"Checks",
"that",
"the",
"given",
"file",
"can",
"be",
"deleted",
"throwing",
"an",
"exception",
"if",
"it",
"can",
"t",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L467-L488 |
111,804 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.copy | public void copy(
JimfsPath source,
FileSystemView destView,
JimfsPath dest,
Set<CopyOption> options,
boolean move)
throws IOException {
checkNotNull(source);
checkNotNull(destView);
checkNotNull(dest);
checkNotNull(options);
boolean sameFileSystem = isSameFileSy... | java | public void copy(
JimfsPath source,
FileSystemView destView,
JimfsPath dest,
Set<CopyOption> options,
boolean move)
throws IOException {
checkNotNull(source);
checkNotNull(destView);
checkNotNull(dest);
checkNotNull(options);
boolean sameFileSystem = isSameFileSy... | [
"public",
"void",
"copy",
"(",
"JimfsPath",
"source",
",",
"FileSystemView",
"destView",
",",
"JimfsPath",
"dest",
",",
"Set",
"<",
"CopyOption",
">",
"options",
",",
"boolean",
"move",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"source",
")",
"... | Copies or moves the file at the given source path to the given dest path. | [
"Copies",
"or",
"moves",
"the",
"file",
"at",
"the",
"given",
"source",
"path",
"to",
"the",
"given",
"dest",
"path",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L498-L608 |
111,805 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.checkNotAncestor | private void checkNotAncestor(File source, Directory destParent, FileSystemView destView)
throws IOException {
// if dest is not in the same file system, it couldn't be in source's subdirectories
if (!isSameFileSystem(destView)) {
return;
}
Directory current = destParent;
while (true) {... | java | private void checkNotAncestor(File source, Directory destParent, FileSystemView destView)
throws IOException {
// if dest is not in the same file system, it couldn't be in source's subdirectories
if (!isSameFileSystem(destView)) {
return;
}
Directory current = destParent;
while (true) {... | [
"private",
"void",
"checkNotAncestor",
"(",
"File",
"source",
",",
"Directory",
"destParent",
",",
"FileSystemView",
"destView",
")",
"throws",
"IOException",
"{",
"// if dest is not in the same file system, it couldn't be in source's subdirectories",
"if",
"(",
"!",
"isSameF... | Checks that source is not an ancestor of dest, throwing an exception if it is. | [
"Checks",
"that",
"source",
"is",
"not",
"an",
"ancestor",
"of",
"dest",
"throwing",
"an",
"exception",
"if",
"it",
"is",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L640-L660 |
111,806 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.lockSourceAndCopy | private void lockSourceAndCopy(File sourceFile, File copyFile) {
sourceFile.opened();
ReadWriteLock sourceLock = sourceFile.contentLock();
if (sourceLock != null) {
sourceLock.readLock().lock();
}
ReadWriteLock copyLock = copyFile.contentLock();
if (copyLock != null) {
copyLock.write... | java | private void lockSourceAndCopy(File sourceFile, File copyFile) {
sourceFile.opened();
ReadWriteLock sourceLock = sourceFile.contentLock();
if (sourceLock != null) {
sourceLock.readLock().lock();
}
ReadWriteLock copyLock = copyFile.contentLock();
if (copyLock != null) {
copyLock.write... | [
"private",
"void",
"lockSourceAndCopy",
"(",
"File",
"sourceFile",
",",
"File",
"copyFile",
")",
"{",
"sourceFile",
".",
"opened",
"(",
")",
";",
"ReadWriteLock",
"sourceLock",
"=",
"sourceFile",
".",
"contentLock",
"(",
")",
";",
"if",
"(",
"sourceLock",
"!... | Locks source and copy files before copying content. Also marks the source file as opened so
that its content won't be deleted until after the copy if it is deleted. | [
"Locks",
"source",
"and",
"copy",
"files",
"before",
"copying",
"content",
".",
"Also",
"marks",
"the",
"source",
"file",
"as",
"opened",
"so",
"that",
"its",
"content",
"won",
"t",
"be",
"deleted",
"until",
"after",
"the",
"copy",
"if",
"it",
"is",
"del... | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L666-L676 |
111,807 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.unlockSourceAndCopy | private void unlockSourceAndCopy(File sourceFile, File copyFile) {
ReadWriteLock sourceLock = sourceFile.contentLock();
if (sourceLock != null) {
sourceLock.readLock().unlock();
}
ReadWriteLock copyLock = copyFile.contentLock();
if (copyLock != null) {
copyLock.writeLock().unlock();
... | java | private void unlockSourceAndCopy(File sourceFile, File copyFile) {
ReadWriteLock sourceLock = sourceFile.contentLock();
if (sourceLock != null) {
sourceLock.readLock().unlock();
}
ReadWriteLock copyLock = copyFile.contentLock();
if (copyLock != null) {
copyLock.writeLock().unlock();
... | [
"private",
"void",
"unlockSourceAndCopy",
"(",
"File",
"sourceFile",
",",
"File",
"copyFile",
")",
"{",
"ReadWriteLock",
"sourceLock",
"=",
"sourceFile",
".",
"contentLock",
"(",
")",
";",
"if",
"(",
"sourceLock",
"!=",
"null",
")",
"{",
"sourceLock",
".",
"... | Unlocks source and copy files after copying content. Also closes the source file so its content
can be deleted if it was deleted. | [
"Unlocks",
"source",
"and",
"copy",
"files",
"after",
"copying",
"content",
".",
"Also",
"closes",
"the",
"source",
"file",
"so",
"its",
"content",
"can",
"be",
"deleted",
"if",
"it",
"was",
"deleted",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L682-L692 |
111,808 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.getFileAttributeView | @Nullable
public <V extends FileAttributeView> V getFileAttributeView(FileLookup lookup, Class<V> type) {
return store.getFileAttributeView(lookup, type);
} | java | @Nullable
public <V extends FileAttributeView> V getFileAttributeView(FileLookup lookup, Class<V> type) {
return store.getFileAttributeView(lookup, type);
} | [
"@",
"Nullable",
"public",
"<",
"V",
"extends",
"FileAttributeView",
">",
"V",
"getFileAttributeView",
"(",
"FileLookup",
"lookup",
",",
"Class",
"<",
"V",
">",
"type",
")",
"{",
"return",
"store",
".",
"getFileAttributeView",
"(",
"lookup",
",",
"type",
")"... | Returns a file attribute view using the given lookup callback. | [
"Returns",
"a",
"file",
"attribute",
"view",
"using",
"the",
"given",
"lookup",
"callback",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L695-L698 |
111,809 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.getFileAttributeView | @Nullable
public <V extends FileAttributeView> V getFileAttributeView(
final JimfsPath path, Class<V> type, final Set<? super LinkOption> options) {
return store.getFileAttributeView(
new FileLookup() {
@Override
public File lookup() throws IOException {
return lookUp... | java | @Nullable
public <V extends FileAttributeView> V getFileAttributeView(
final JimfsPath path, Class<V> type, final Set<? super LinkOption> options) {
return store.getFileAttributeView(
new FileLookup() {
@Override
public File lookup() throws IOException {
return lookUp... | [
"@",
"Nullable",
"public",
"<",
"V",
"extends",
"FileAttributeView",
">",
"V",
"getFileAttributeView",
"(",
"final",
"JimfsPath",
"path",
",",
"Class",
"<",
"V",
">",
"type",
",",
"final",
"Set",
"<",
"?",
"super",
"LinkOption",
">",
"options",
")",
"{",
... | Returns a file attribute view for the given path in this view. | [
"Returns",
"a",
"file",
"attribute",
"view",
"for",
"the",
"given",
"path",
"in",
"this",
"view",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L701-L712 |
111,810 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.readAttributes | public <A extends BasicFileAttributes> A readAttributes(
JimfsPath path, Class<A> type, Set<? super LinkOption> options) throws IOException {
File file = lookUpWithLock(path, options).requireExists(path).file();
return store.readAttributes(file, type);
} | java | public <A extends BasicFileAttributes> A readAttributes(
JimfsPath path, Class<A> type, Set<? super LinkOption> options) throws IOException {
File file = lookUpWithLock(path, options).requireExists(path).file();
return store.readAttributes(file, type);
} | [
"public",
"<",
"A",
"extends",
"BasicFileAttributes",
">",
"A",
"readAttributes",
"(",
"JimfsPath",
"path",
",",
"Class",
"<",
"A",
">",
"type",
",",
"Set",
"<",
"?",
"super",
"LinkOption",
">",
"options",
")",
"throws",
"IOException",
"{",
"File",
"file",... | Reads attributes of the file located by the given path in this view as an object. | [
"Reads",
"attributes",
"of",
"the",
"file",
"located",
"by",
"the",
"given",
"path",
"in",
"this",
"view",
"as",
"an",
"object",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L715-L719 |
111,811 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.readAttributes | public ImmutableMap<String, Object> readAttributes(
JimfsPath path, String attributes, Set<? super LinkOption> options) throws IOException {
File file = lookUpWithLock(path, options).requireExists(path).file();
return store.readAttributes(file, attributes);
} | java | public ImmutableMap<String, Object> readAttributes(
JimfsPath path, String attributes, Set<? super LinkOption> options) throws IOException {
File file = lookUpWithLock(path, options).requireExists(path).file();
return store.readAttributes(file, attributes);
} | [
"public",
"ImmutableMap",
"<",
"String",
",",
"Object",
">",
"readAttributes",
"(",
"JimfsPath",
"path",
",",
"String",
"attributes",
",",
"Set",
"<",
"?",
"super",
"LinkOption",
">",
"options",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"lookUp... | Reads attributes of the file located by the given path in this view as a map. | [
"Reads",
"attributes",
"of",
"the",
"file",
"located",
"by",
"the",
"given",
"path",
"in",
"this",
"view",
"as",
"a",
"map",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L722-L726 |
111,812 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java | FileSystemView.setAttribute | public void setAttribute(
JimfsPath path, String attribute, Object value, Set<? super LinkOption> options)
throws IOException {
File file = lookUpWithLock(path, options).requireExists(path).file();
store.setAttribute(file, attribute, value);
} | java | public void setAttribute(
JimfsPath path, String attribute, Object value, Set<? super LinkOption> options)
throws IOException {
File file = lookUpWithLock(path, options).requireExists(path).file();
store.setAttribute(file, attribute, value);
} | [
"public",
"void",
"setAttribute",
"(",
"JimfsPath",
"path",
",",
"String",
"attribute",
",",
"Object",
"value",
",",
"Set",
"<",
"?",
"super",
"LinkOption",
">",
"options",
")",
"throws",
"IOException",
"{",
"File",
"file",
"=",
"lookUpWithLock",
"(",
"path"... | Sets the given attribute to the given value on the file located by the given path in this view. | [
"Sets",
"the",
"given",
"attribute",
"to",
"the",
"given",
"value",
"on",
"the",
"file",
"located",
"by",
"the",
"given",
"path",
"in",
"this",
"view",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/FileSystemView.java#L731-L736 |
111,813 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/AttributeService.java | AttributeService.setInitialAttributes | public void setInitialAttributes(File file, FileAttribute<?>... attrs) {
// default values should already be sanitized by their providers
for (int i = 0; i < defaultValues.size(); i++) {
FileAttribute<?> attribute = defaultValues.get(i);
int separatorIndex = attribute.name().indexOf(':');
Str... | java | public void setInitialAttributes(File file, FileAttribute<?>... attrs) {
// default values should already be sanitized by their providers
for (int i = 0; i < defaultValues.size(); i++) {
FileAttribute<?> attribute = defaultValues.get(i);
int separatorIndex = attribute.name().indexOf(':');
Str... | [
"public",
"void",
"setInitialAttributes",
"(",
"File",
"file",
",",
"FileAttribute",
"<",
"?",
">",
"...",
"attrs",
")",
"{",
"// default values should already be sanitized by their providers",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"defaultValues",
".",... | Sets all initial attributes for the given file, including the given attributes if possible. | [
"Sets",
"all",
"initial",
"attributes",
"for",
"the",
"given",
"file",
"including",
"the",
"given",
"attributes",
"if",
"possible",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeService.java#L155-L169 |
111,814 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/AttributeService.java | AttributeService.copyAttributes | public void copyAttributes(File file, File copy, AttributeCopyOption copyOption) {
switch (copyOption) {
case ALL:
file.copyAttributes(copy);
break;
case BASIC:
file.copyBasicAttributes(copy);
break;
default:
// don't copy
}
} | java | public void copyAttributes(File file, File copy, AttributeCopyOption copyOption) {
switch (copyOption) {
case ALL:
file.copyAttributes(copy);
break;
case BASIC:
file.copyBasicAttributes(copy);
break;
default:
// don't copy
}
} | [
"public",
"void",
"copyAttributes",
"(",
"File",
"file",
",",
"File",
"copy",
",",
"AttributeCopyOption",
"copyOption",
")",
"{",
"switch",
"(",
"copyOption",
")",
"{",
"case",
"ALL",
":",
"file",
".",
"copyAttributes",
"(",
"copy",
")",
";",
"break",
";",... | Copies the attributes of the given file to the given copy file. | [
"Copies",
"the",
"attributes",
"of",
"the",
"given",
"file",
"to",
"the",
"given",
"copy",
"file",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeService.java#L172-L183 |
111,815 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/AttributeService.java | AttributeService.setAttribute | public void setAttribute(File file, String attribute, Object value, boolean create) {
String view = getViewName(attribute);
String attr = getSingleAttribute(attribute);
setAttributeInternal(file, view, attr, value, create);
} | java | public void setAttribute(File file, String attribute, Object value, boolean create) {
String view = getViewName(attribute);
String attr = getSingleAttribute(attribute);
setAttributeInternal(file, view, attr, value, create);
} | [
"public",
"void",
"setAttribute",
"(",
"File",
"file",
",",
"String",
"attribute",
",",
"Object",
"value",
",",
"boolean",
"create",
")",
"{",
"String",
"view",
"=",
"getViewName",
"(",
"attribute",
")",
";",
"String",
"attr",
"=",
"getSingleAttribute",
"(",... | Sets the value of the given attribute to the given value for the given file. | [
"Sets",
"the",
"value",
"of",
"the",
"given",
"attribute",
"to",
"the",
"given",
"value",
"for",
"the",
"given",
"file",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/AttributeService.java#L228-L232 |
111,816 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java | JimfsFileStore.lookUp | DirectoryEntry lookUp(File workingDirectory, JimfsPath path, Set<? super LinkOption> options)
throws IOException {
state.checkOpen();
return tree.lookUp(workingDirectory, path, options);
} | java | DirectoryEntry lookUp(File workingDirectory, JimfsPath path, Set<? super LinkOption> options)
throws IOException {
state.checkOpen();
return tree.lookUp(workingDirectory, path, options);
} | [
"DirectoryEntry",
"lookUp",
"(",
"File",
"workingDirectory",
",",
"JimfsPath",
"path",
",",
"Set",
"<",
"?",
"super",
"LinkOption",
">",
"options",
")",
"throws",
"IOException",
"{",
"state",
".",
"checkOpen",
"(",
")",
";",
"return",
"tree",
".",
"lookUp",
... | Looks up the file at the given path using the given link options. If the path is relative, the
lookup is relative to the given working directory.
@throws NoSuchFileException if an element of the path other than the final element does not
resolve to a directory or symbolic link (e.g. it doesn't exist or is a regular fi... | [
"Looks",
"up",
"the",
"file",
"at",
"the",
"given",
"path",
"using",
"the",
"given",
"link",
"options",
".",
"If",
"the",
"path",
"is",
"relative",
"the",
"lookup",
"is",
"relative",
"to",
"the",
"given",
"working",
"directory",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java#L125-L129 |
111,817 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java | JimfsFileStore.symbolicLinkCreator | Supplier<SymbolicLink> symbolicLinkCreator(JimfsPath target) {
state.checkOpen();
return factory.symbolicLinkCreator(target);
} | java | Supplier<SymbolicLink> symbolicLinkCreator(JimfsPath target) {
state.checkOpen();
return factory.symbolicLinkCreator(target);
} | [
"Supplier",
"<",
"SymbolicLink",
">",
"symbolicLinkCreator",
"(",
"JimfsPath",
"target",
")",
"{",
"state",
".",
"checkOpen",
"(",
")",
";",
"return",
"factory",
".",
"symbolicLinkCreator",
"(",
"target",
")",
";",
"}"
] | Returns a supplier that creates a new symbolic link with the given target. | [
"Returns",
"a",
"supplier",
"that",
"creates",
"a",
"new",
"symbolic",
"link",
"with",
"the",
"given",
"target",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java#L144-L147 |
111,818 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java | JimfsFileStore.setInitialAttributes | void setInitialAttributes(File file, FileAttribute<?>... attrs) {
state.checkOpen();
attributes.setInitialAttributes(file, attrs);
} | java | void setInitialAttributes(File file, FileAttribute<?>... attrs) {
state.checkOpen();
attributes.setInitialAttributes(file, attrs);
} | [
"void",
"setInitialAttributes",
"(",
"File",
"file",
",",
"FileAttribute",
"<",
"?",
">",
"...",
"attrs",
")",
"{",
"state",
".",
"checkOpen",
"(",
")",
";",
"attributes",
".",
"setInitialAttributes",
"(",
"file",
",",
"attrs",
")",
";",
"}"
] | Sets initial attributes on the given file. Sets default attributes first, then attempts to set
the given user-provided attributes. | [
"Sets",
"initial",
"attributes",
"on",
"the",
"given",
"file",
".",
"Sets",
"default",
"attributes",
"first",
"then",
"attempts",
"to",
"set",
"the",
"given",
"user",
"-",
"provided",
"attributes",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java#L164-L167 |
111,819 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java | JimfsFileStore.readAttributes | ImmutableMap<String, Object> readAttributes(File file, String attributes) {
state.checkOpen();
return this.attributes.readAttributes(file, attributes);
} | java | ImmutableMap<String, Object> readAttributes(File file, String attributes) {
state.checkOpen();
return this.attributes.readAttributes(file, attributes);
} | [
"ImmutableMap",
"<",
"String",
",",
"Object",
">",
"readAttributes",
"(",
"File",
"file",
",",
"String",
"attributes",
")",
"{",
"state",
".",
"checkOpen",
"(",
")",
";",
"return",
"this",
".",
"attributes",
".",
"readAttributes",
"(",
"file",
",",
"attrib... | Returns a map containing the attributes described by the given string mapped to their values. | [
"Returns",
"a",
"map",
"containing",
"the",
"attributes",
"described",
"by",
"the",
"given",
"string",
"mapped",
"to",
"their",
"values",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java#L182-L185 |
111,820 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java | JimfsFileStore.setAttribute | void setAttribute(File file, String attribute, Object value) {
state.checkOpen();
// TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter
attributes.setAttribute(file, attribute, value, false);
} | java | void setAttribute(File file, String attribute, Object value) {
state.checkOpen();
// TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter
attributes.setAttribute(file, attribute, value, false);
} | [
"void",
"setAttribute",
"(",
"File",
"file",
",",
"String",
"attribute",
",",
"Object",
"value",
")",
"{",
"state",
".",
"checkOpen",
"(",
")",
";",
"// TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter",
"attributes",
".",
"setAttribute",
"(",
... | Sets the given attribute to the given value for the given file. | [
"Sets",
"the",
"given",
"attribute",
"to",
"the",
"given",
"value",
"for",
"the",
"given",
"file",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java#L198-L202 |
111,821 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/UnixAttributeProvider.java | UnixAttributeProvider.getUniqueId | private Integer getUniqueId(Object object) {
Integer id = idCache.get(object);
if (id == null) {
id = uidGenerator.incrementAndGet();
Integer existing = idCache.putIfAbsent(object, id);
if (existing != null) {
return existing;
}
}
return id;
} | java | private Integer getUniqueId(Object object) {
Integer id = idCache.get(object);
if (id == null) {
id = uidGenerator.incrementAndGet();
Integer existing = idCache.putIfAbsent(object, id);
if (existing != null) {
return existing;
}
}
return id;
} | [
"private",
"Integer",
"getUniqueId",
"(",
"Object",
"object",
")",
"{",
"Integer",
"id",
"=",
"idCache",
".",
"get",
"(",
"object",
")",
";",
"if",
"(",
"id",
"==",
"null",
")",
"{",
"id",
"=",
"uidGenerator",
".",
"incrementAndGet",
"(",
")",
";",
"... | Returns an ID that is guaranteed to be the same for any invocation with equal objects. | [
"Returns",
"an",
"ID",
"that",
"is",
"guaranteed",
"to",
"be",
"the",
"same",
"for",
"any",
"invocation",
"with",
"equal",
"objects",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/UnixAttributeProvider.java#L85-L95 |
111,822 | google/jimfs | jimfs/src/main/java/com/google/common/jimfs/Configuration.java | Configuration.forCurrentPlatform | public static Configuration forCurrentPlatform() {
String os = System.getProperty("os.name");
if (os.contains("Windows")) {
return windows();
} else if (os.contains("OS X")) {
return osX();
} else {
return unix();
}
} | java | public static Configuration forCurrentPlatform() {
String os = System.getProperty("os.name");
if (os.contains("Windows")) {
return windows();
} else if (os.contains("OS X")) {
return osX();
} else {
return unix();
}
} | [
"public",
"static",
"Configuration",
"forCurrentPlatform",
"(",
")",
"{",
"String",
"os",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"if",
"(",
"os",
".",
"contains",
"(",
"\"Windows\"",
")",
")",
"{",
"return",
"windows",
"(",
")",
... | Returns a default configuration appropriate to the current operating system.
<p>More specifically, if the operating system is Windows, {@link Configuration#windows()} is
returned; if the operating system is Mac OS X, {@link Configuration#osX()} is returned;
otherwise, {@link Configuration#unix()} is returned.
<p>This... | [
"Returns",
"a",
"default",
"configuration",
"appropriate",
"to",
"the",
"current",
"operating",
"system",
"."
] | 3eadff747a3afa7b498030f420d2d04ce700534a | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/Configuration.java#L204-L214 |
111,823 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.getSuperParameterizedType | public static ParameterizedType getSuperParameterizedType(Type type, Class<?> superClass) {
if (type instanceof Class<?> || type instanceof ParameterizedType) {
outer:
while (type != null && type != Object.class) {
Class<?> rawType;
if (type instanceof Class<?>) {
// type is a ... | java | public static ParameterizedType getSuperParameterizedType(Type type, Class<?> superClass) {
if (type instanceof Class<?> || type instanceof ParameterizedType) {
outer:
while (type != null && type != Object.class) {
Class<?> rawType;
if (type instanceof Class<?>) {
// type is a ... | [
"public",
"static",
"ParameterizedType",
"getSuperParameterizedType",
"(",
"Type",
"type",
",",
"Class",
"<",
"?",
">",
"superClass",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
"<",
"?",
">",
"||",
"type",
"instanceof",
"ParameterizedType",
")",
"{",
... | Returns the parameterized type that is or extends the given type that matches the given super
class.
<p>For example, if the input type is {@code HashMap<String,Integer>} and the input super class
is {@code Map.class}, it will return the extended parameterized type {@link Map}, but which
retains the actual type informa... | [
"Returns",
"the",
"parameterized",
"type",
"that",
"is",
"or",
"extends",
"the",
"given",
"type",
"that",
"matches",
"the",
"given",
"super",
"class",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L53-L89 |
111,824 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.isAssignableToOrFrom | public static boolean isAssignableToOrFrom(Class<?> classToCheck, Class<?> anotherClass) {
return classToCheck.isAssignableFrom(anotherClass)
|| anotherClass.isAssignableFrom(classToCheck);
} | java | public static boolean isAssignableToOrFrom(Class<?> classToCheck, Class<?> anotherClass) {
return classToCheck.isAssignableFrom(anotherClass)
|| anotherClass.isAssignableFrom(classToCheck);
} | [
"public",
"static",
"boolean",
"isAssignableToOrFrom",
"(",
"Class",
"<",
"?",
">",
"classToCheck",
",",
"Class",
"<",
"?",
">",
"anotherClass",
")",
"{",
"return",
"classToCheck",
".",
"isAssignableFrom",
"(",
"anotherClass",
")",
"||",
"anotherClass",
".",
"... | Returns whether a class is either assignable to or from another class.
@param classToCheck class to check
@param anotherClass another class | [
"Returns",
"whether",
"a",
"class",
"is",
"either",
"assignable",
"to",
"or",
"from",
"another",
"class",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L97-L100 |
111,825 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.newInstance | public static <T> T newInstance(Class<T> clazz) {
// TODO(yanivi): investigate "sneaky" options for allocating the class that GSON uses, like
// setting the constructor to be accessible, or possibly provide a factory method of a special
// name
try {
return clazz.newInstance();
} catch (Illega... | java | public static <T> T newInstance(Class<T> clazz) {
// TODO(yanivi): investigate "sneaky" options for allocating the class that GSON uses, like
// setting the constructor to be accessible, or possibly provide a factory method of a special
// name
try {
return clazz.newInstance();
} catch (Illega... | [
"public",
"static",
"<",
"T",
">",
"T",
"newInstance",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"// TODO(yanivi): investigate \"sneaky\" options for allocating the class that GSON uses, like",
"// setting the constructor to be accessible, or possibly provide a factory method o... | Creates a new instance of the given class by invoking its default constructor.
<p>The given class must be public and must have a public default constructor, and must not be
an array or an interface or be abstract. If an enclosing class, it must be static. | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"given",
"class",
"by",
"invoking",
"its",
"default",
"constructor",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L108-L119 |
111,826 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.getBound | public static Type getBound(WildcardType wildcardType) {
Type[] lowerBounds = wildcardType.getLowerBounds();
if (lowerBounds.length != 0) {
return lowerBounds[0];
}
return wildcardType.getUpperBounds()[0];
} | java | public static Type getBound(WildcardType wildcardType) {
Type[] lowerBounds = wildcardType.getLowerBounds();
if (lowerBounds.length != 0) {
return lowerBounds[0];
}
return wildcardType.getUpperBounds()[0];
} | [
"public",
"static",
"Type",
"getBound",
"(",
"WildcardType",
"wildcardType",
")",
"{",
"Type",
"[",
"]",
"lowerBounds",
"=",
"wildcardType",
".",
"getLowerBounds",
"(",
")",
";",
"if",
"(",
"lowerBounds",
".",
"length",
"!=",
"0",
")",
"{",
"return",
"lowe... | Returns the only bound of the given wildcard type.
@param wildcardType wildcard type
@return only bound or {@code Object.class} for none | [
"Returns",
"the",
"only",
"bound",
"of",
"the",
"given",
"wildcard",
"type",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L202-L208 |
111,827 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.resolveTypeVariable | public static Type resolveTypeVariable(List<Type> context, TypeVariable<?> typeVariable) {
// determine where the type variable was declared
GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration();
if (genericDeclaration instanceof Class<?>) {
Class<?> rawGenericDeclaration = (Cla... | java | public static Type resolveTypeVariable(List<Type> context, TypeVariable<?> typeVariable) {
// determine where the type variable was declared
GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration();
if (genericDeclaration instanceof Class<?>) {
Class<?> rawGenericDeclaration = (Cla... | [
"public",
"static",
"Type",
"resolveTypeVariable",
"(",
"List",
"<",
"Type",
">",
"context",
",",
"TypeVariable",
"<",
"?",
">",
"typeVariable",
")",
"{",
"// determine where the type variable was declared",
"GenericDeclaration",
"genericDeclaration",
"=",
"typeVariable",... | Resolves the actual type of the given type variable that comes from a field type based on the
given context list.
<p>In case the type variable can be resolved partially, it will return the partially resolved
type variable.
@param context context list, ordering from least specific to most specific type context, for
ex... | [
"Resolves",
"the",
"actual",
"type",
"of",
"the",
"given",
"type",
"variable",
"that",
"comes",
"from",
"a",
"field",
"type",
"based",
"on",
"the",
"given",
"context",
"list",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L223-L259 |
111,828 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Types.java | Types.iterableOf | @SuppressWarnings("unchecked")
public static <T> Iterable<T> iterableOf(final Object value) {
if (value instanceof Iterable<?>) {
return (Iterable<T>) value;
}
Class<?> valueClass = value.getClass();
Preconditions.checkArgument(valueClass.isArray(), "not an array or Iterable: %s", valueClass);
... | java | @SuppressWarnings("unchecked")
public static <T> Iterable<T> iterableOf(final Object value) {
if (value instanceof Iterable<?>) {
return (Iterable<T>) value;
}
Class<?> valueClass = value.getClass();
Preconditions.checkArgument(valueClass.isArray(), "not an array or Iterable: %s", valueClass);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"Iterable",
"<",
"T",
">",
"iterableOf",
"(",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"instanceof",
"Iterable",
"<",
"?",
">",
")",
"{",
"return",
... | Returns an iterable for an input iterable or array value.
<p>If the input value extends {@link Iterable}, it will just return the input value. Otherwise,
it will return an iterable that can handle arrays of primitive and non-primitive component
type.
@param value iterable (extends {@link Iterable}) or array value
@re... | [
"Returns",
"an",
"iterable",
"for",
"an",
"input",
"iterable",
"or",
"array",
"value",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Types.java#L342-L378 |
111,829 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/SslUtils.java | SslUtils.initSslContext | public static SSLContext initSslContext(
SSLContext sslContext, KeyStore trustStore, TrustManagerFactory trustManagerFactory)
throws GeneralSecurityException {
trustManagerFactory.init(trustStore);
sslContext.init(null, trustManagerFactory.getTrustManagers(), null);
return sslContext;
} | java | public static SSLContext initSslContext(
SSLContext sslContext, KeyStore trustStore, TrustManagerFactory trustManagerFactory)
throws GeneralSecurityException {
trustManagerFactory.init(trustStore);
sslContext.init(null, trustManagerFactory.getTrustManagers(), null);
return sslContext;
} | [
"public",
"static",
"SSLContext",
"initSslContext",
"(",
"SSLContext",
"sslContext",
",",
"KeyStore",
"trustStore",
",",
"TrustManagerFactory",
"trustManagerFactory",
")",
"throws",
"GeneralSecurityException",
"{",
"trustManagerFactory",
".",
"init",
"(",
"trustStore",
")... | Initializes the SSL context to the trust managers supplied by the trust manager factory for the
given trust store.
@param sslContext SSL context (for example {@link SSLContext#getInstance})
@param trustStore key store for certificates to trust (for example {@link
SecurityUtils#getJavaKeyStore()})
@param trustManagerFa... | [
"Initializes",
"the",
"SSL",
"context",
"to",
"the",
"trust",
"managers",
"supplied",
"by",
"the",
"trust",
"manager",
"factory",
"for",
"the",
"given",
"trust",
"store",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/SslUtils.java#L104-L110 |
111,830 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Base64.java | Base64.decodeBase64 | public static byte[] decodeBase64(String base64String) {
try {
return BaseEncoding.base64().decode(base64String);
} catch (IllegalArgumentException e) {
if (e.getCause() instanceof DecodingException) {
return BaseEncoding.base64Url().decode(base64String);
}
throw e;
}
} | java | public static byte[] decodeBase64(String base64String) {
try {
return BaseEncoding.base64().decode(base64String);
} catch (IllegalArgumentException e) {
if (e.getCause() instanceof DecodingException) {
return BaseEncoding.base64Url().decode(base64String);
}
throw e;
}
} | [
"public",
"static",
"byte",
"[",
"]",
"decodeBase64",
"(",
"String",
"base64String",
")",
"{",
"try",
"{",
"return",
"BaseEncoding",
".",
"base64",
"(",
")",
".",
"decode",
"(",
"base64String",
")",
";",
"}",
"catch",
"(",
"IllegalArgumentException",
"e",
... | Decodes a Base64 String into octets. Note that this method handles both URL-safe and
non-URL-safe base 64 encoded strings.
@param base64String String containing Base64 data or {@code null} for {@code null} result
@return Array containing decoded data or {@code null} for {@code null} input | [
"Decodes",
"a",
"Base64",
"String",
"into",
"octets",
".",
"Note",
"that",
"this",
"method",
"handles",
"both",
"URL",
"-",
"safe",
"and",
"non",
"-",
"URL",
"-",
"safe",
"base",
"64",
"encoded",
"strings",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Base64.java#L90-L99 |
111,831 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/apache/ApacheHttpTransport.java | ApacheHttpTransport.newDefaultHttpParams | static HttpParams newDefaultHttpParams() {
HttpParams params = new BasicHttpParams();
// Turn off stale checking. Our connections break all the time anyway,
// and it's not worth it to pay the penalty of checking every time.
HttpConnectionParams.setStaleCheckingEnabled(params, false);
HttpConnection... | java | static HttpParams newDefaultHttpParams() {
HttpParams params = new BasicHttpParams();
// Turn off stale checking. Our connections break all the time anyway,
// and it's not worth it to pay the penalty of checking every time.
HttpConnectionParams.setStaleCheckingEnabled(params, false);
HttpConnection... | [
"static",
"HttpParams",
"newDefaultHttpParams",
"(",
")",
"{",
"HttpParams",
"params",
"=",
"new",
"BasicHttpParams",
"(",
")",
";",
"// Turn off stale checking. Our connections break all the time anyway,",
"// and it's not worth it to pay the penalty of checking every time.",
"HttpC... | Returns a new instance of the default HTTP parameters we use. | [
"Returns",
"a",
"new",
"instance",
"of",
"the",
"default",
"HTTP",
"parameters",
"we",
"use",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/apache/ApacheHttpTransport.java#L152-L161 |
111,832 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/atom/AbstractAtomFeedParser.java | AbstractAtomFeedParser.parseFeed | public T parseFeed() throws IOException, XmlPullParserException {
boolean close = true;
try {
this.feedParsed = true;
T result = Types.newInstance(feedClass);
Xml.parseElement(parser, result, namespaceDictionary, Atom.StopAtAtomEntry.INSTANCE);
close = false;
return result;
} f... | java | public T parseFeed() throws IOException, XmlPullParserException {
boolean close = true;
try {
this.feedParsed = true;
T result = Types.newInstance(feedClass);
Xml.parseElement(parser, result, namespaceDictionary, Atom.StopAtAtomEntry.INSTANCE);
close = false;
return result;
} f... | [
"public",
"T",
"parseFeed",
"(",
")",
"throws",
"IOException",
",",
"XmlPullParserException",
"{",
"boolean",
"close",
"=",
"true",
";",
"try",
"{",
"this",
".",
"feedParsed",
"=",
"true",
";",
"T",
"result",
"=",
"Types",
".",
"newInstance",
"(",
"feedCla... | Parse the feed and return a new parsed instance of the feed type. This method can be skipped if
all you want are the items.
@throws IOException I/O exception
@throws XmlPullParserException XML pull parser exception | [
"Parse",
"the",
"feed",
"and",
"return",
"a",
"new",
"parsed",
"instance",
"of",
"the",
"feed",
"type",
".",
"This",
"method",
"can",
"be",
"skipped",
"if",
"all",
"you",
"want",
"are",
"the",
"items",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/atom/AbstractAtomFeedParser.java#L116-L129 |
111,833 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parseAndClose | public final <T> T parseAndClose(Class<T> destinationClass) throws IOException {
return parseAndClose(destinationClass, null);
} | java | public final <T> T parseAndClose(Class<T> destinationClass) throws IOException {
return parseAndClose(destinationClass, null);
} | [
"public",
"final",
"<",
"T",
">",
"T",
"parseAndClose",
"(",
"Class",
"<",
"T",
">",
"destinationClass",
")",
"throws",
"IOException",
"{",
"return",
"parseAndClose",
"(",
"destinationClass",
",",
"null",
")",
";",
"}"
] | Parse a JSON object, array, or value into a new instance of the given destination class, and
then closes the parser.
@param <T> destination class
@param destinationClass destination class that has a public default constructor to use to
create a new instance
@return new instance of the parsed destination class
@since 1... | [
"Parse",
"a",
"JSON",
"object",
"array",
"or",
"value",
"into",
"a",
"new",
"instance",
"of",
"the",
"given",
"destination",
"class",
"and",
"then",
"closes",
"the",
"parser",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L145-L147 |
111,834 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.skipToKey | public final String skipToKey(Set<String> keysToFind) throws IOException {
JsonToken curToken = startParsingObjectOrArray();
while (curToken == JsonToken.FIELD_NAME) {
String key = getText();
nextToken();
if (keysToFind.contains(key)) {
return key;
}
skipChildren();
c... | java | public final String skipToKey(Set<String> keysToFind) throws IOException {
JsonToken curToken = startParsingObjectOrArray();
while (curToken == JsonToken.FIELD_NAME) {
String key = getText();
nextToken();
if (keysToFind.contains(key)) {
return key;
}
skipChildren();
c... | [
"public",
"final",
"String",
"skipToKey",
"(",
"Set",
"<",
"String",
">",
"keysToFind",
")",
"throws",
"IOException",
"{",
"JsonToken",
"curToken",
"=",
"startParsingObjectOrArray",
"(",
")",
";",
"while",
"(",
"curToken",
"==",
"JsonToken",
".",
"FIELD_NAME",
... | Skips the values of all keys in the current object until it finds one of the given keys.
<p>Before this method is called, the parser must either point to the start or end of a JSON
object or to a field name. After this method ends, the current token will either be the {@link
JsonToken#END_OBJECT} of the current object... | [
"Skips",
"the",
"values",
"of",
"all",
"keys",
"in",
"the",
"current",
"object",
"until",
"it",
"finds",
"one",
"of",
"the",
"given",
"keys",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L196-L208 |
111,835 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.startParsingObjectOrArray | private JsonToken startParsingObjectOrArray() throws IOException {
JsonToken currentToken = startParsing();
switch (currentToken) {
case START_OBJECT:
currentToken = nextToken();
Preconditions.checkArgument(
currentToken == JsonToken.FIELD_NAME || currentToken == JsonToken.END_... | java | private JsonToken startParsingObjectOrArray() throws IOException {
JsonToken currentToken = startParsing();
switch (currentToken) {
case START_OBJECT:
currentToken = nextToken();
Preconditions.checkArgument(
currentToken == JsonToken.FIELD_NAME || currentToken == JsonToken.END_... | [
"private",
"JsonToken",
"startParsingObjectOrArray",
"(",
")",
"throws",
"IOException",
"{",
"JsonToken",
"currentToken",
"=",
"startParsing",
"(",
")",
";",
"switch",
"(",
"currentToken",
")",
"{",
"case",
"START_OBJECT",
":",
"currentToken",
"=",
"nextToken",
"(... | Starts parsing an object or array by making sure the parser points to an object field name,
first array value or end of object or array.
<p>If the parser is at the start of input, {@link #nextToken()} is called. The current token
must then be {@link JsonToken#START_OBJECT}, {@link JsonToken#END_OBJECT}, {@link
JsonTok... | [
"Starts",
"parsing",
"an",
"object",
"or",
"array",
"by",
"making",
"sure",
"the",
"parser",
"points",
"to",
"an",
"object",
"field",
"name",
"first",
"array",
"value",
"or",
"end",
"of",
"object",
"or",
"array",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L231-L247 |
111,836 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parse | private void parse(
ArrayList<Type> context, Object destination, CustomizeJsonParser customizeParser)
throws IOException {
if (destination instanceof GenericJson) {
((GenericJson) destination).setFactory(getFactory());
}
JsonToken curToken = startParsingObjectOrArray();
Class<?> destin... | java | private void parse(
ArrayList<Type> context, Object destination, CustomizeJsonParser customizeParser)
throws IOException {
if (destination instanceof GenericJson) {
((GenericJson) destination).setFactory(getFactory());
}
JsonToken curToken = startParsingObjectOrArray();
Class<?> destin... | [
"private",
"void",
"parse",
"(",
"ArrayList",
"<",
"Type",
">",
"context",
",",
"Object",
"destination",
",",
"CustomizeJsonParser",
"customizeParser",
")",
"throws",
"IOException",
"{",
"if",
"(",
"destination",
"instanceof",
"GenericJson",
")",
"{",
"(",
"(",
... | Parses the next field from the given JSON parser into the given destination object.
@param context destination context stack (possibly empty)
@param destination destination object instance or {@code null} for none (for example empty
context stack)
@param customizeParser optional parser customizer or {@code null} for n... | [
"Parses",
"the",
"next",
"field",
"from",
"the",
"given",
"JSON",
"parser",
"into",
"the",
"given",
"destination",
"object",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L412-L470 |
111,837 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parseArray | private <T> void parseArray(
Field fieldContext,
Collection<T> destinationCollection,
Type destinationItemType,
ArrayList<Type> context,
CustomizeJsonParser customizeParser)
throws IOException {
JsonToken curToken = startParsingObjectOrArray();
while (curToken != JsonToken.EN... | java | private <T> void parseArray(
Field fieldContext,
Collection<T> destinationCollection,
Type destinationItemType,
ArrayList<Type> context,
CustomizeJsonParser customizeParser)
throws IOException {
JsonToken curToken = startParsingObjectOrArray();
while (curToken != JsonToken.EN... | [
"private",
"<",
"T",
">",
"void",
"parseArray",
"(",
"Field",
"fieldContext",
",",
"Collection",
"<",
"T",
">",
"destinationCollection",
",",
"Type",
"destinationItemType",
",",
"ArrayList",
"<",
"Type",
">",
"context",
",",
"CustomizeJsonParser",
"customizeParser... | Parse a JSON Array from the given JSON parser into the given destination collection, optionally
using the given parser customizer.
@param fieldContext field context or {@code null} for none
@param destinationCollection destination collection
@param destinationItemType type of destination collection item
@param context... | [
"Parse",
"a",
"JSON",
"Array",
"from",
"the",
"given",
"JSON",
"parser",
"into",
"the",
"given",
"destination",
"collection",
"optionally",
"using",
"the",
"given",
"parser",
"customizer",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L631-L653 |
111,838 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parseMap | private void parseMap(
Field fieldContext,
Map<String, Object> destinationMap,
Type valueType,
ArrayList<Type> context,
CustomizeJsonParser customizeParser)
throws IOException {
JsonToken curToken = startParsingObjectOrArray();
while (curToken == JsonToken.FIELD_NAME) {
... | java | private void parseMap(
Field fieldContext,
Map<String, Object> destinationMap,
Type valueType,
ArrayList<Type> context,
CustomizeJsonParser customizeParser)
throws IOException {
JsonToken curToken = startParsingObjectOrArray();
while (curToken == JsonToken.FIELD_NAME) {
... | [
"private",
"void",
"parseMap",
"(",
"Field",
"fieldContext",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"destinationMap",
",",
"Type",
"valueType",
",",
"ArrayList",
"<",
"Type",
">",
"context",
",",
"CustomizeJsonParser",
"customizeParser",
")",
"throws",
... | Parse a JSON Object from the given JSON parser into the given destination map, optionally using
the given parser customizer.
@param fieldContext field context or {@code null} for none
@param destinationMap destination map
@param valueType valueType of the map value type parameter
@param context destination context sta... | [
"Parse",
"a",
"JSON",
"Object",
"from",
"the",
"given",
"JSON",
"parser",
"into",
"the",
"given",
"destination",
"map",
"optionally",
"using",
"the",
"given",
"parser",
"customizer",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L665-L685 |
111,839 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomFeedParser.java | AtomFeedParser.create | public static <T, E> AtomFeedParser<T, E> create(
HttpResponse response,
XmlNamespaceDictionary namespaceDictionary,
Class<T> feedClass,
Class<E> entryClass)
throws IOException, XmlPullParserException {
InputStream content = response.getContent();
try {
Atom.checkContentType(... | java | public static <T, E> AtomFeedParser<T, E> create(
HttpResponse response,
XmlNamespaceDictionary namespaceDictionary,
Class<T> feedClass,
Class<E> entryClass)
throws IOException, XmlPullParserException {
InputStream content = response.getContent();
try {
Atom.checkContentType(... | [
"public",
"static",
"<",
"T",
",",
"E",
">",
"AtomFeedParser",
"<",
"T",
",",
"E",
">",
"create",
"(",
"HttpResponse",
"response",
",",
"XmlNamespaceDictionary",
"namespaceDictionary",
",",
"Class",
"<",
"T",
">",
"feedClass",
",",
"Class",
"<",
"E",
">",
... | Parses the given HTTP response using the given feed class and entry class.
@param <T> feed type
@param <E> entry type
@param response HTTP response
@param namespaceDictionary XML namespace dictionary
@param feedClass feed class
@param entryClass entry class
@return Atom feed parser
@throws IOException I/O exception
@t... | [
"Parses",
"the",
"given",
"HTTP",
"response",
"using",
"the",
"given",
"feed",
"class",
"and",
"entry",
"class",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomFeedParser.java#L99-L119 |
111,840 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/ArrayValueMap.java | ArrayValueMap.setValues | public void setValues() {
for (Map.Entry<String, ArrayValueMap.ArrayValue> entry : keyMap.entrySet()) {
@SuppressWarnings("unchecked")
Map<String, Object> destinationMap = (Map<String, Object>) destination;
destinationMap.put(entry.getKey(), entry.getValue().toArray());
}
for (Map.Entry<Fi... | java | public void setValues() {
for (Map.Entry<String, ArrayValueMap.ArrayValue> entry : keyMap.entrySet()) {
@SuppressWarnings("unchecked")
Map<String, Object> destinationMap = (Map<String, Object>) destination;
destinationMap.put(entry.getKey(), entry.getValue().toArray());
}
for (Map.Entry<Fi... | [
"public",
"void",
"setValues",
"(",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"ArrayValueMap",
".",
"ArrayValue",
">",
"entry",
":",
"keyMap",
".",
"entrySet",
"(",
")",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
... | Sets the fields of the given object using the values collected during parsing of the object's
fields. | [
"Sets",
"the",
"fields",
"of",
"the",
"given",
"object",
"using",
"the",
"values",
"collected",
"during",
"parsing",
"of",
"the",
"object",
"s",
"fields",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/ArrayValueMap.java#L92-L101 |
111,841 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/ArrayValueMap.java | ArrayValueMap.put | public void put(Field field, Class<?> arrayComponentType, Object value) {
ArrayValueMap.ArrayValue arrayValue = fieldMap.get(field);
if (arrayValue == null) {
arrayValue = new ArrayValue(arrayComponentType);
fieldMap.put(field, arrayValue);
}
arrayValue.addValue(arrayComponentType, value);
... | java | public void put(Field field, Class<?> arrayComponentType, Object value) {
ArrayValueMap.ArrayValue arrayValue = fieldMap.get(field);
if (arrayValue == null) {
arrayValue = new ArrayValue(arrayComponentType);
fieldMap.put(field, arrayValue);
}
arrayValue.addValue(arrayComponentType, value);
... | [
"public",
"void",
"put",
"(",
"Field",
"field",
",",
"Class",
"<",
"?",
">",
"arrayComponentType",
",",
"Object",
"value",
")",
"{",
"ArrayValueMap",
".",
"ArrayValue",
"arrayValue",
"=",
"fieldMap",
".",
"get",
"(",
"field",
")",
";",
"if",
"(",
"arrayV... | Puts an additional value for the given field, accumulating values on repeated calls on the same
field.
@param field field
@param arrayComponentType array component type
@param value value | [
"Puts",
"an",
"additional",
"value",
"for",
"the",
"given",
"field",
"accumulating",
"values",
"on",
"repeated",
"calls",
"on",
"the",
"same",
"field",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/ArrayValueMap.java#L111-L118 |
111,842 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/ArrayValueMap.java | ArrayValueMap.put | public void put(String keyName, Class<?> arrayComponentType, Object value) {
ArrayValueMap.ArrayValue arrayValue = keyMap.get(keyName);
if (arrayValue == null) {
arrayValue = new ArrayValue(arrayComponentType);
keyMap.put(keyName, arrayValue);
}
arrayValue.addValue(arrayComponentType, value)... | java | public void put(String keyName, Class<?> arrayComponentType, Object value) {
ArrayValueMap.ArrayValue arrayValue = keyMap.get(keyName);
if (arrayValue == null) {
arrayValue = new ArrayValue(arrayComponentType);
keyMap.put(keyName, arrayValue);
}
arrayValue.addValue(arrayComponentType, value)... | [
"public",
"void",
"put",
"(",
"String",
"keyName",
",",
"Class",
"<",
"?",
">",
"arrayComponentType",
",",
"Object",
"value",
")",
"{",
"ArrayValueMap",
".",
"ArrayValue",
"arrayValue",
"=",
"keyMap",
".",
"get",
"(",
"keyName",
")",
";",
"if",
"(",
"arr... | Puts an additional value for the given key name, accumulating values on repeated calls on the
same key name.
@param keyName key name
@param arrayComponentType array component type
@param value value | [
"Puts",
"an",
"additional",
"value",
"for",
"the",
"given",
"key",
"name",
"accumulating",
"values",
"on",
"repeated",
"calls",
"on",
"the",
"same",
"key",
"name",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/ArrayValueMap.java#L128-L135 |
111,843 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java | HttpRequest.handleRedirect | public boolean handleRedirect(int statusCode, HttpHeaders responseHeaders) {
String redirectLocation = responseHeaders.getLocation();
if (getFollowRedirects()
&& HttpStatusCodes.isRedirect(statusCode)
&& redirectLocation != null) {
// resolve the redirect location relative to the current l... | java | public boolean handleRedirect(int statusCode, HttpHeaders responseHeaders) {
String redirectLocation = responseHeaders.getLocation();
if (getFollowRedirects()
&& HttpStatusCodes.isRedirect(statusCode)
&& redirectLocation != null) {
// resolve the redirect location relative to the current l... | [
"public",
"boolean",
"handleRedirect",
"(",
"int",
"statusCode",
",",
"HttpHeaders",
"responseHeaders",
")",
"{",
"String",
"redirectLocation",
"=",
"responseHeaders",
".",
"getLocation",
"(",
")",
";",
"if",
"(",
"getFollowRedirects",
"(",
")",
"&&",
"HttpStatusC... | Sets up this request object to handle the necessary redirect if redirects are turned on, it is
a redirect status code and the header has a location.
<p>When the status code is {@code 303} the method on the request is changed to a GET as per the
RFC2616 specification. On a redirect, it also removes the {@code "Authoriz... | [
"Sets",
"up",
"this",
"request",
"object",
"to",
"handle",
"the",
"necessary",
"redirect",
"if",
"redirects",
"are",
"turned",
"on",
"it",
"is",
"a",
"redirect",
"status",
"code",
"and",
"the",
"header",
"has",
"a",
"location",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpRequest.java#L1153-L1176 |
111,844 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java | AtomContent.forEntry | public static AtomContent forEntry(XmlNamespaceDictionary namespaceDictionary, Object entry) {
return new AtomContent(namespaceDictionary, entry, true);
} | java | public static AtomContent forEntry(XmlNamespaceDictionary namespaceDictionary, Object entry) {
return new AtomContent(namespaceDictionary, entry, true);
} | [
"public",
"static",
"AtomContent",
"forEntry",
"(",
"XmlNamespaceDictionary",
"namespaceDictionary",
",",
"Object",
"entry",
")",
"{",
"return",
"new",
"AtomContent",
"(",
"namespaceDictionary",
",",
"entry",
",",
"true",
")",
";",
"}"
] | Returns a new instance of HTTP content for an Atom entry.
@param namespaceDictionary XML namespace dictionary
@param entry data key/value pair for the Atom entry
@since 1.5 | [
"Returns",
"a",
"new",
"instance",
"of",
"HTTP",
"content",
"for",
"an",
"Atom",
"entry",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java#L80-L82 |
111,845 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java | AtomContent.forFeed | public static AtomContent forFeed(XmlNamespaceDictionary namespaceDictionary, Object feed) {
return new AtomContent(namespaceDictionary, feed, false);
} | java | public static AtomContent forFeed(XmlNamespaceDictionary namespaceDictionary, Object feed) {
return new AtomContent(namespaceDictionary, feed, false);
} | [
"public",
"static",
"AtomContent",
"forFeed",
"(",
"XmlNamespaceDictionary",
"namespaceDictionary",
",",
"Object",
"feed",
")",
"{",
"return",
"new",
"AtomContent",
"(",
"namespaceDictionary",
",",
"feed",
",",
"false",
")",
";",
"}"
] | Returns a new instance of HTTP content for an Atom feed.
@param namespaceDictionary XML namespace dictionary
@param feed data key/value pair for the Atom feed
@since 1.5 | [
"Returns",
"a",
"new",
"instance",
"of",
"HTTP",
"content",
"for",
"an",
"Atom",
"feed",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/http/xml/atom/AtomContent.java#L91-L93 |
111,846 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java | HttpMediaType.setParameter | public HttpMediaType setParameter(String name, String value) {
if (value == null) {
removeParameter(name);
return this;
}
Preconditions.checkArgument(
TOKEN_REGEX.matcher(name).matches(), "Name contains reserved characters");
cachedBuildResult = null;
parameters.put(name.toLower... | java | public HttpMediaType setParameter(String name, String value) {
if (value == null) {
removeParameter(name);
return this;
}
Preconditions.checkArgument(
TOKEN_REGEX.matcher(name).matches(), "Name contains reserved characters");
cachedBuildResult = null;
parameters.put(name.toLower... | [
"public",
"HttpMediaType",
"setParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"removeParameter",
"(",
"name",
")",
";",
"return",
"this",
";",
"}",
"Preconditions",
".",
"checkArgument",
"("... | Sets the media parameter to the specified value.
@param name case-insensitive name of the parameter
@param value value of the parameter or {@code null} to remove | [
"Sets",
"the",
"media",
"parameter",
"to",
"the",
"specified",
"value",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java#L203-L214 |
111,847 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java | HttpMediaType.removeParameter | public HttpMediaType removeParameter(String name) {
cachedBuildResult = null;
parameters.remove(name.toLowerCase(Locale.US));
return this;
} | java | public HttpMediaType removeParameter(String name) {
cachedBuildResult = null;
parameters.remove(name.toLowerCase(Locale.US));
return this;
} | [
"public",
"HttpMediaType",
"removeParameter",
"(",
"String",
"name",
")",
"{",
"cachedBuildResult",
"=",
"null",
";",
"parameters",
".",
"remove",
"(",
"name",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
")",
";",
"return",
"this",
";",
"}"
] | Removes the specified media parameter.
@param name parameter to remove | [
"Removes",
"the",
"specified",
"media",
"parameter",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java#L230-L234 |
111,848 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java | HttpMediaType.build | public String build() {
if (cachedBuildResult != null) {
return cachedBuildResult;
}
StringBuilder str = new StringBuilder();
str.append(type);
str.append('/');
str.append(subType);
if (parameters != null) {
for (Entry<String, String> entry : parameters.entrySet()) {
Str... | java | public String build() {
if (cachedBuildResult != null) {
return cachedBuildResult;
}
StringBuilder str = new StringBuilder();
str.append(type);
str.append('/');
str.append(subType);
if (parameters != null) {
for (Entry<String, String> entry : parameters.entrySet()) {
Str... | [
"public",
"String",
"build",
"(",
")",
"{",
"if",
"(",
"cachedBuildResult",
"!=",
"null",
")",
"{",
"return",
"cachedBuildResult",
";",
"}",
"StringBuilder",
"str",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"str",
".",
"append",
"(",
"type",
")",
";",
... | Builds the full media type string which can be passed in the Content-Type header. | [
"Builds",
"the",
"full",
"media",
"type",
"string",
"which",
"can",
"be",
"passed",
"in",
"the",
"Content",
"-",
"Type",
"header",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java#L265-L285 |
111,849 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java | HttpMediaType.setCharsetParameter | public HttpMediaType setCharsetParameter(Charset charset) {
setParameter("charset", charset == null ? null : charset.name());
return this;
} | java | public HttpMediaType setCharsetParameter(Charset charset) {
setParameter("charset", charset == null ? null : charset.name());
return this;
} | [
"public",
"HttpMediaType",
"setCharsetParameter",
"(",
"Charset",
"charset",
")",
"{",
"setParameter",
"(",
"\"charset\"",
",",
"charset",
"==",
"null",
"?",
"null",
":",
"charset",
".",
"name",
"(",
")",
")",
";",
"return",
"this",
";",
"}"
] | Sets the charset parameter of the media type.
@param charset new value for the charset parameter or {@code null} to remove | [
"Sets",
"the",
"charset",
"parameter",
"of",
"the",
"media",
"type",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpMediaType.java#L319-L322 |
111,850 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/UriTemplate.java | UriTemplate.expand | public static String expand(
String baseUrl, String uriTemplate, Object parameters, boolean addUnusedParamsAsQueryParams) {
String pathUri;
if (uriTemplate.startsWith("/")) {
// Remove the base path from the base URL.
GenericUrl url = new GenericUrl(baseUrl);
url.setRawPath(null);
... | java | public static String expand(
String baseUrl, String uriTemplate, Object parameters, boolean addUnusedParamsAsQueryParams) {
String pathUri;
if (uriTemplate.startsWith("/")) {
// Remove the base path from the base URL.
GenericUrl url = new GenericUrl(baseUrl);
url.setRawPath(null);
... | [
"public",
"static",
"String",
"expand",
"(",
"String",
"baseUrl",
",",
"String",
"uriTemplate",
",",
"Object",
"parameters",
",",
"boolean",
"addUnusedParamsAsQueryParams",
")",
"{",
"String",
"pathUri",
";",
"if",
"(",
"uriTemplate",
".",
"startsWith",
"(",
"\"... | Expands templates in a URI template that is relative to a base URL.
<p>If the URI template starts with a "/" the raw path from the base URL is stripped out. If the
URI template is a full URL then it is used instead of the base URL.
<p>Supports Level 1 templates and all Level 4 composite templates as described in: <a
... | [
"Expands",
"templates",
"in",
"a",
"URI",
"template",
"that",
"is",
"relative",
"to",
"a",
"base",
"URL",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/UriTemplate.java#L216-L230 |
111,851 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpResponseException.java | HttpResponseException.computeMessageBuffer | public static StringBuilder computeMessageBuffer(HttpResponse response) {
StringBuilder builder = new StringBuilder();
int statusCode = response.getStatusCode();
if (statusCode != 0) {
builder.append(statusCode);
}
String statusMessage = response.getStatusMessage();
if (statusMessage != nu... | java | public static StringBuilder computeMessageBuffer(HttpResponse response) {
StringBuilder builder = new StringBuilder();
int statusCode = response.getStatusCode();
if (statusCode != 0) {
builder.append(statusCode);
}
String statusMessage = response.getStatusMessage();
if (statusMessage != nu... | [
"public",
"static",
"StringBuilder",
"computeMessageBuffer",
"(",
"HttpResponse",
"response",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"int",
"statusCode",
"=",
"response",
".",
"getStatusCode",
"(",
")",
";",
"if",
"(",
... | Returns an exception message string builder to use for the given HTTP response.
@since 1.7 | [
"Returns",
"an",
"exception",
"message",
"string",
"builder",
"to",
"use",
"for",
"the",
"given",
"HTTP",
"response",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpResponseException.java#L274-L288 |
111,852 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/BackOffUtils.java | BackOffUtils.next | public static boolean next(Sleeper sleeper, BackOff backOff)
throws InterruptedException, IOException {
long backOffTime = backOff.nextBackOffMillis();
if (backOffTime == BackOff.STOP) {
return false;
}
sleeper.sleep(backOffTime);
return true;
} | java | public static boolean next(Sleeper sleeper, BackOff backOff)
throws InterruptedException, IOException {
long backOffTime = backOff.nextBackOffMillis();
if (backOffTime == BackOff.STOP) {
return false;
}
sleeper.sleep(backOffTime);
return true;
} | [
"public",
"static",
"boolean",
"next",
"(",
"Sleeper",
"sleeper",
",",
"BackOff",
"backOff",
")",
"throws",
"InterruptedException",
",",
"IOException",
"{",
"long",
"backOffTime",
"=",
"backOff",
".",
"nextBackOffMillis",
"(",
")",
";",
"if",
"(",
"backOffTime",... | Runs the next iteration of the back-off policy, and returns whether to continue to retry the
operation.
<p>If {@code true}, it will call {@link Sleeper#sleep(long)} with the specified number of
milliseconds from {@link BackOff#nextBackOffMillis()}.
@param sleeper sleeper
@param backOff back-off policy
@return whether... | [
"Runs",
"the",
"next",
"iteration",
"of",
"the",
"back",
"-",
"off",
"policy",
"and",
"returns",
"whether",
"to",
"continue",
"to",
"retry",
"the",
"operation",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/BackOffUtils.java#L42-L50 |
111,853 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/MultipartContent.java | MultipartContent.setContentParts | public MultipartContent setContentParts(Collection<? extends HttpContent> contentParts) {
this.parts = new ArrayList<Part>(contentParts.size());
for (HttpContent contentPart : contentParts) {
addPart(new Part(contentPart));
}
return this;
} | java | public MultipartContent setContentParts(Collection<? extends HttpContent> contentParts) {
this.parts = new ArrayList<Part>(contentParts.size());
for (HttpContent contentPart : contentParts) {
addPart(new Part(contentPart));
}
return this;
} | [
"public",
"MultipartContent",
"setContentParts",
"(",
"Collection",
"<",
"?",
"extends",
"HttpContent",
">",
"contentParts",
")",
"{",
"this",
".",
"parts",
"=",
"new",
"ArrayList",
"<",
"Part",
">",
"(",
"contentParts",
".",
"size",
"(",
")",
")",
";",
"f... | Sets the HTTP content parts of the HTTP multipart request, where each part is assumed to have
no HTTP headers and no encoding.
<p>Overriding is only supported for the purpose of calling the super implementation and
changing the return type, but nothing else. | [
"Sets",
"the",
"HTTP",
"content",
"parts",
"of",
"the",
"HTTP",
"multipart",
"request",
"where",
"each",
"part",
"is",
"assumed",
"to",
"have",
"no",
"HTTP",
"headers",
"and",
"no",
"encoding",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/MultipartContent.java#L166-L172 |
111,854 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java | HttpHeaders.toStringValue | private static String toStringValue(Object headerValue) {
return headerValue instanceof Enum<?>
? FieldInfo.of((Enum<?>) headerValue).getName()
: headerValue.toString();
} | java | private static String toStringValue(Object headerValue) {
return headerValue instanceof Enum<?>
? FieldInfo.of((Enum<?>) headerValue).getName()
: headerValue.toString();
} | [
"private",
"static",
"String",
"toStringValue",
"(",
"Object",
"headerValue",
")",
"{",
"return",
"headerValue",
"instanceof",
"Enum",
"<",
"?",
">",
"?",
"FieldInfo",
".",
"of",
"(",
"(",
"Enum",
"<",
"?",
">",
")",
"headerValue",
")",
".",
"getName",
"... | Returns the string header value for the given header value as an object. | [
"Returns",
"the",
"string",
"header",
"value",
"for",
"the",
"given",
"header",
"value",
"as",
"an",
"object",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java#L869-L873 |
111,855 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java | HttpHeaders.getFirstHeaderValue | private <T> T getFirstHeaderValue(List<T> internalValue) {
return internalValue == null ? null : internalValue.get(0);
} | java | private <T> T getFirstHeaderValue(List<T> internalValue) {
return internalValue == null ? null : internalValue.get(0);
} | [
"private",
"<",
"T",
">",
"T",
"getFirstHeaderValue",
"(",
"List",
"<",
"T",
">",
"internalValue",
")",
"{",
"return",
"internalValue",
"==",
"null",
"?",
"null",
":",
"internalValue",
".",
"get",
"(",
"0",
")",
";",
"}"
] | Returns the first header value based on the given internal list value. | [
"Returns",
"the",
"first",
"header",
"value",
"based",
"on",
"the",
"given",
"internal",
"list",
"value",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java#L991-L993 |
111,856 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java | HttpHeaders.getAsList | private <T> List<T> getAsList(T passedValue) {
if (passedValue == null) {
return null;
}
List<T> result = new ArrayList<T>();
result.add(passedValue);
return result;
} | java | private <T> List<T> getAsList(T passedValue) {
if (passedValue == null) {
return null;
}
List<T> result = new ArrayList<T>();
result.add(passedValue);
return result;
} | [
"private",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getAsList",
"(",
"T",
"passedValue",
")",
"{",
"if",
"(",
"passedValue",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"T",
">",
"result",
"=",
"new",
"ArrayList",
"<",
"T",
">"... | Returns the list value to use for the given parameter passed to the setter method. | [
"Returns",
"the",
"list",
"value",
"to",
"use",
"for",
"the",
"given",
"parameter",
"passed",
"to",
"the",
"setter",
"method",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java#L996-L1003 |
111,857 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java | HttpHeaders.getFirstHeaderStringValue | public String getFirstHeaderStringValue(String name) {
Object value = get(name.toLowerCase(Locale.US));
if (value == null) {
return null;
}
Class<? extends Object> valueClass = value.getClass();
if (value instanceof Iterable<?> || valueClass.isArray()) {
for (Object repeatedValue : Types... | java | public String getFirstHeaderStringValue(String name) {
Object value = get(name.toLowerCase(Locale.US));
if (value == null) {
return null;
}
Class<? extends Object> valueClass = value.getClass();
if (value instanceof Iterable<?> || valueClass.isArray()) {
for (Object repeatedValue : Types... | [
"public",
"String",
"getFirstHeaderStringValue",
"(",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"name",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";"... | Returns the first header string value for the given header name.
@param name header name (may be any case)
@return first header string value or {@code null} if not found
@since 1.13 | [
"Returns",
"the",
"first",
"header",
"string",
"value",
"for",
"the",
"given",
"header",
"name",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java#L1012-L1024 |
111,858 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java | HttpHeaders.getHeaderStringValues | public List<String> getHeaderStringValues(String name) {
Object value = get(name.toLowerCase(Locale.US));
if (value == null) {
return Collections.emptyList();
}
Class<? extends Object> valueClass = value.getClass();
if (value instanceof Iterable<?> || valueClass.isArray()) {
List<String>... | java | public List<String> getHeaderStringValues(String name) {
Object value = get(name.toLowerCase(Locale.US));
if (value == null) {
return Collections.emptyList();
}
Class<? extends Object> valueClass = value.getClass();
if (value instanceof Iterable<?> || valueClass.isArray()) {
List<String>... | [
"public",
"List",
"<",
"String",
">",
"getHeaderStringValues",
"(",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"name",
".",
"toLowerCase",
"(",
"Locale",
".",
"US",
")",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"retu... | Returns an unmodifiable list of the header string values for the given header name.
@param name header name (may be any case)
@return header string values or empty if not found
@since 1.13 | [
"Returns",
"an",
"unmodifiable",
"list",
"of",
"the",
"header",
"string",
"values",
"for",
"the",
"given",
"header",
"name",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java#L1033-L1047 |
111,859 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java | HttpHeaders.parseHeader | void parseHeader(String headerName, String headerValue, ParseHeaderState state) {
List<Type> context = state.context;
ClassInfo classInfo = state.classInfo;
ArrayValueMap arrayValueMap = state.arrayValueMap;
StringBuilder logger = state.logger;
if (logger != null) {
logger.append(headerName +... | java | void parseHeader(String headerName, String headerValue, ParseHeaderState state) {
List<Type> context = state.context;
ClassInfo classInfo = state.classInfo;
ArrayValueMap arrayValueMap = state.arrayValueMap;
StringBuilder logger = state.logger;
if (logger != null) {
logger.append(headerName +... | [
"void",
"parseHeader",
"(",
"String",
"headerName",
",",
"String",
"headerValue",
",",
"ParseHeaderState",
"state",
")",
"{",
"List",
"<",
"Type",
">",
"context",
"=",
"state",
".",
"context",
";",
"ClassInfo",
"classInfo",
"=",
"state",
".",
"classInfo",
";... | Parses the specified case-insensitive header pair into this HttpHeaders instance. | [
"Parses",
"the",
"specified",
"case",
"-",
"insensitive",
"header",
"pair",
"into",
"this",
"HttpHeaders",
"instance",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpHeaders.java#L1102-L1149 |
111,860 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java | GenericUrl.buildAuthority | public final String buildAuthority() {
// scheme, [user info], host, [port]
StringBuilder buf = new StringBuilder();
buf.append(Preconditions.checkNotNull(scheme));
buf.append("://");
if (userInfo != null) {
buf.append(CharEscapers.escapeUriUserInfo(userInfo)).append('@');
}
buf.append... | java | public final String buildAuthority() {
// scheme, [user info], host, [port]
StringBuilder buf = new StringBuilder();
buf.append(Preconditions.checkNotNull(scheme));
buf.append("://");
if (userInfo != null) {
buf.append(CharEscapers.escapeUriUserInfo(userInfo)).append('@');
}
buf.append... | [
"public",
"final",
"String",
"buildAuthority",
"(",
")",
"{",
"// scheme, [user info], host, [port]",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"buf",
".",
"append",
"(",
"Preconditions",
".",
"checkNotNull",
"(",
"scheme",
")",
")",
";... | Constructs the portion of the URL containing the scheme, host and port.
<p>For the URL {@code "http://example.com/something?action=add"} this method would return
{@code "http://example.com"}.
@return scheme://[user-info@]host[:port]
@since 1.9 | [
"Constructs",
"the",
"portion",
"of",
"the",
"URL",
"containing",
"the",
"scheme",
"host",
"and",
"port",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java#L330-L344 |
111,861 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java | GenericUrl.buildRelativeUrl | public final String buildRelativeUrl() {
StringBuilder buf = new StringBuilder();
if (pathParts != null) {
appendRawPathFromParts(buf);
}
addQueryParams(entrySet(), buf);
// URL fragment
String fragment = this.fragment;
if (fragment != null) {
buf.append('#').append(URI_FRAGMENT... | java | public final String buildRelativeUrl() {
StringBuilder buf = new StringBuilder();
if (pathParts != null) {
appendRawPathFromParts(buf);
}
addQueryParams(entrySet(), buf);
// URL fragment
String fragment = this.fragment;
if (fragment != null) {
buf.append('#').append(URI_FRAGMENT... | [
"public",
"final",
"String",
"buildRelativeUrl",
"(",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"if",
"(",
"pathParts",
"!=",
"null",
")",
"{",
"appendRawPathFromParts",
"(",
"buf",
")",
";",
"}",
"addQueryParams",
"(",
... | Constructs the portion of the URL beginning at the rooted path.
<p>For the URL {@code "http://example.com/something?action=add"} this method would return
{@code "/something?action=add"}.
@return path with with leading '/' if the path is non-empty, query parameters and fragment
@since 1.9 | [
"Constructs",
"the",
"portion",
"of",
"the",
"URL",
"beginning",
"at",
"the",
"rooted",
"path",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java#L355-L368 |
111,862 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java | GenericUrl.getFirst | public Object getFirst(String name) {
Object value = get(name);
if (value instanceof Collection<?>) {
@SuppressWarnings("unchecked")
Collection<Object> collectionValue = (Collection<Object>) value;
Iterator<Object> iterator = collectionValue.iterator();
return iterator.hasNext() ? iterat... | java | public Object getFirst(String name) {
Object value = get(name);
if (value instanceof Collection<?>) {
@SuppressWarnings("unchecked")
Collection<Object> collectionValue = (Collection<Object>) value;
Iterator<Object> iterator = collectionValue.iterator();
return iterator.hasNext() ? iterat... | [
"public",
"Object",
"getFirst",
"(",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"value",
"instanceof",
"Collection",
"<",
"?",
">",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"Collectio... | Returns the first query parameter value for the given query parameter name.
@param name query parameter name
@return first query parameter value | [
"Returns",
"the",
"first",
"query",
"parameter",
"value",
"for",
"the",
"given",
"query",
"parameter",
"name",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java#L418-L427 |
111,863 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java | GenericUrl.getAll | public Collection<Object> getAll(String name) {
Object value = get(name);
if (value == null) {
return Collections.emptySet();
}
if (value instanceof Collection<?>) {
@SuppressWarnings("unchecked")
Collection<Object> collectionValue = (Collection<Object>) value;
return Collections... | java | public Collection<Object> getAll(String name) {
Object value = get(name);
if (value == null) {
return Collections.emptySet();
}
if (value instanceof Collection<?>) {
@SuppressWarnings("unchecked")
Collection<Object> collectionValue = (Collection<Object>) value;
return Collections... | [
"public",
"Collection",
"<",
"Object",
">",
"getAll",
"(",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"name",
")",
";",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptySet",
"(",
")",
";",
"}",
"... | Returns all query parameter values for the given query parameter name.
@param name query parameter name
@return unmodifiable collection of query parameter values (possibly empty) | [
"Returns",
"all",
"query",
"parameter",
"values",
"for",
"the",
"given",
"query",
"parameter",
"name",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java#L435-L446 |
111,864 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java | GenericUrl.toPathParts | public static List<String> toPathParts(String encodedPath) {
if (encodedPath == null || encodedPath.length() == 0) {
return null;
}
List<String> result = new ArrayList<String>();
int cur = 0;
boolean notDone = true;
while (notDone) {
int slash = encodedPath.indexOf('/', cur);
n... | java | public static List<String> toPathParts(String encodedPath) {
if (encodedPath == null || encodedPath.length() == 0) {
return null;
}
List<String> result = new ArrayList<String>();
int cur = 0;
boolean notDone = true;
while (notDone) {
int slash = encodedPath.indexOf('/', cur);
n... | [
"public",
"static",
"List",
"<",
"String",
">",
"toPathParts",
"(",
"String",
"encodedPath",
")",
"{",
"if",
"(",
"encodedPath",
"==",
"null",
"||",
"encodedPath",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
... | Returns the decoded path parts for the given encoded path.
@param encodedPath slash-prefixed encoded path, for example {@code
"/m8/feeds/contacts/default/full"}
@return decoded path parts, with each part assumed to be preceded by a {@code '/'}, for example
{@code "", "m8", "feeds", "contacts", "default", "full"}, or {... | [
"Returns",
"the",
"decoded",
"path",
"parts",
"for",
"the",
"given",
"encoded",
"path",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java#L505-L525 |
111,865 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java | GenericUrl.addQueryParams | static void addQueryParams(Set<Entry<String, Object>> entrySet, StringBuilder buf) {
// (similar to UrlEncodedContent)
boolean first = true;
for (Map.Entry<String, Object> nameValueEntry : entrySet) {
Object value = nameValueEntry.getValue();
if (value != null) {
String name = CharEscape... | java | static void addQueryParams(Set<Entry<String, Object>> entrySet, StringBuilder buf) {
// (similar to UrlEncodedContent)
boolean first = true;
for (Map.Entry<String, Object> nameValueEntry : entrySet) {
Object value = nameValueEntry.getValue();
if (value != null) {
String name = CharEscape... | [
"static",
"void",
"addQueryParams",
"(",
"Set",
"<",
"Entry",
"<",
"String",
",",
"Object",
">",
">",
"entrySet",
",",
"StringBuilder",
"buf",
")",
"{",
"// (similar to UrlEncodedContent)",
"boolean",
"first",
"=",
"true",
";",
"for",
"(",
"Map",
".",
"Entry... | Adds query parameters from the provided entrySet into the buffer. | [
"Adds",
"query",
"parameters",
"from",
"the",
"provided",
"entrySet",
"into",
"the",
"buffer",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/GenericUrl.java#L541-L558 |
111,866 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/Xml.java | Xml.parseAttributeOrTextContent | private static void parseAttributeOrTextContent(
String stringValue,
Field field,
Type valueType,
List<Type> context,
Object destination,
GenericXml genericXml,
Map<String, Object> destinationMap,
String name) {
if (field != null || genericXml != null || destinationMa... | java | private static void parseAttributeOrTextContent(
String stringValue,
Field field,
Type valueType,
List<Type> context,
Object destination,
GenericXml genericXml,
Map<String, Object> destinationMap,
String name) {
if (field != null || genericXml != null || destinationMa... | [
"private",
"static",
"void",
"parseAttributeOrTextContent",
"(",
"String",
"stringValue",
",",
"Field",
"field",
",",
"Type",
"valueType",
",",
"List",
"<",
"Type",
">",
"context",
",",
"Object",
"destination",
",",
"GenericXml",
"genericXml",
",",
"Map",
"<",
... | Parses the string value of an attribute value or text content.
@param stringValue string value
@param field field to set or {@code null} if not applicable
@param valueType value type (class, parameterized type, or generic array type) or {@code null}
for none
@param context context list, going from least specific to mo... | [
"Parses",
"the",
"string",
"value",
"of",
"an",
"attribute",
"value",
"or",
"text",
"content",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/Xml.java#L120-L134 |
111,867 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/Xml.java | Xml.setValue | private static void setValue(
Object value,
Field field,
Object destination,
GenericXml genericXml,
Map<String, Object> destinationMap,
String name) {
if (field != null) {
FieldInfo.setFieldValue(field, destination, value);
} else if (genericXml != null) {
generic... | java | private static void setValue(
Object value,
Field field,
Object destination,
GenericXml genericXml,
Map<String, Object> destinationMap,
String name) {
if (field != null) {
FieldInfo.setFieldValue(field, destination, value);
} else if (genericXml != null) {
generic... | [
"private",
"static",
"void",
"setValue",
"(",
"Object",
"value",
",",
"Field",
"field",
",",
"Object",
"destination",
",",
"GenericXml",
"genericXml",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"destinationMap",
",",
"String",
"name",
")",
"{",
"if",
"... | Sets the value of a given field or map entry.
@param value value
@param field field to set or {@code null} if not applicable
@param destination destination object or {@code null} for none
@param genericXml generic XML or {@code null} if not applicable
@param destinationMap destination map or {@code null} if not applic... | [
"Sets",
"the",
"value",
"of",
"a",
"given",
"field",
"or",
"map",
"entry",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/Xml.java#L146-L160 |
111,868 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/Xml.java | Xml.parseElement | public static void parseElement(
XmlPullParser parser,
Object destination,
XmlNamespaceDictionary namespaceDictionary,
CustomizeParser customizeParser)
throws IOException, XmlPullParserException {
ArrayList<Type> context = new ArrayList<Type>();
if (destination != null) {
con... | java | public static void parseElement(
XmlPullParser parser,
Object destination,
XmlNamespaceDictionary namespaceDictionary,
CustomizeParser customizeParser)
throws IOException, XmlPullParserException {
ArrayList<Type> context = new ArrayList<Type>();
if (destination != null) {
con... | [
"public",
"static",
"void",
"parseElement",
"(",
"XmlPullParser",
"parser",
",",
"Object",
"destination",
",",
"XmlNamespaceDictionary",
"namespaceDictionary",
",",
"CustomizeParser",
"customizeParser",
")",
"throws",
"IOException",
",",
"XmlPullParserException",
"{",
"Ar... | Parses an XML element using the given XML pull parser into the given destination object.
<p>Requires the the current event be {@link XmlPullParser#START_TAG} (skipping any initial
{@link XmlPullParser#START_DOCUMENT}) of the element being parsed. At normal parsing
completion, the current event will either be {@link Xm... | [
"Parses",
"an",
"XML",
"element",
"using",
"the",
"given",
"XML",
"pull",
"parser",
"into",
"the",
"given",
"destination",
"object",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/Xml.java#L209-L220 |
111,869 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/Xml.java | Xml.parseNamespacesForElement | private static void parseNamespacesForElement(
XmlPullParser parser, XmlNamespaceDictionary namespaceDictionary)
throws XmlPullParserException {
int eventType = parser.getEventType();
Preconditions.checkState(
eventType == XmlPullParser.START_TAG,
"expected start of XML element, but ... | java | private static void parseNamespacesForElement(
XmlPullParser parser, XmlNamespaceDictionary namespaceDictionary)
throws XmlPullParserException {
int eventType = parser.getEventType();
Preconditions.checkState(
eventType == XmlPullParser.START_TAG,
"expected start of XML element, but ... | [
"private",
"static",
"void",
"parseNamespacesForElement",
"(",
"XmlPullParser",
"parser",
",",
"XmlNamespaceDictionary",
"namespaceDictionary",
")",
"throws",
"XmlPullParserException",
"{",
"int",
"eventType",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"Precondi... | Parses the namespaces declared on the current element into the namespace dictionary.
@param parser XML pull parser
@param namespaceDictionary namespace dictionary | [
"Parses",
"the",
"namespaces",
"declared",
"on",
"the",
"current",
"element",
"into",
"the",
"namespace",
"dictionary",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/Xml.java#L601-L628 |
111,870 | googleapis/google-http-java-client | google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/BetaDetector.java | BetaDetector.getSuperclass | private JavaClass getSuperclass(JavaClass javaClass) {
try {
return javaClass.getSuperClass();
} catch (ClassNotFoundException e) {
bugReporter.reportMissingClass(e);
return null;
}
} | java | private JavaClass getSuperclass(JavaClass javaClass) {
try {
return javaClass.getSuperClass();
} catch (ClassNotFoundException e) {
bugReporter.reportMissingClass(e);
return null;
}
} | [
"private",
"JavaClass",
"getSuperclass",
"(",
"JavaClass",
"javaClass",
")",
"{",
"try",
"{",
"return",
"javaClass",
".",
"getSuperClass",
"(",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"bugReporter",
".",
"reportMissingClass",
"(",
... | Returns the superclass of the specified class. | [
"Returns",
"the",
"superclass",
"of",
"the",
"specified",
"class",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-findbugs/src/main/java/com/google/api/client/findbugs/BetaDetector.java#L149-L156 |
111,871 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java | XmlNamespaceDictionary.set | public synchronized XmlNamespaceDictionary set(String alias, String uri) {
String previousUri = null;
String previousAlias = null;
if (uri == null) {
if (alias != null) {
previousUri = namespaceAliasToUriMap.remove(alias);
}
} else if (alias == null) {
previousAlias = namespace... | java | public synchronized XmlNamespaceDictionary set(String alias, String uri) {
String previousUri = null;
String previousAlias = null;
if (uri == null) {
if (alias != null) {
previousUri = namespaceAliasToUriMap.remove(alias);
}
} else if (alias == null) {
previousAlias = namespace... | [
"public",
"synchronized",
"XmlNamespaceDictionary",
"set",
"(",
"String",
"alias",
",",
"String",
"uri",
")",
"{",
"String",
"previousUri",
"=",
"null",
";",
"String",
"previousAlias",
"=",
"null",
";",
"if",
"(",
"uri",
"==",
"null",
")",
"{",
"if",
"(",
... | Adds a namespace of the given alias and URI.
<p>If the uri is {@code null}, the namespace alias will be removed. Similarly, if the alias is
{@code null}, the namespace URI will be removed. Otherwise, if the alias is already mapped to a
different URI, it will be remapped to the new URI. Similarly, if a URI is already m... | [
"Adds",
"a",
"namespace",
"of",
"the",
"given",
"alias",
"and",
"URI",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java#L127-L153 |
111,872 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java | XmlNamespaceDictionary.getNamespaceUriForAliasHandlingUnknown | String getNamespaceUriForAliasHandlingUnknown(boolean errorOnUnknown, String alias) {
String result = getUriForAlias(alias);
if (result == null) {
Preconditions.checkArgument(
!errorOnUnknown, "unrecognized alias: %s", alias.length() == 0 ? "(default)" : alias);
return "http://unknown/" + ... | java | String getNamespaceUriForAliasHandlingUnknown(boolean errorOnUnknown, String alias) {
String result = getUriForAlias(alias);
if (result == null) {
Preconditions.checkArgument(
!errorOnUnknown, "unrecognized alias: %s", alias.length() == 0 ? "(default)" : alias);
return "http://unknown/" + ... | [
"String",
"getNamespaceUriForAliasHandlingUnknown",
"(",
"boolean",
"errorOnUnknown",
",",
"String",
"alias",
")",
"{",
"String",
"result",
"=",
"getUriForAlias",
"(",
"alias",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"Preconditions",
".",
"checkAr... | Returns the namespace URI to use for serialization for a given namespace alias, possibly using
a predictable made-up namespace URI if the alias is not recognized.
<p>Specifically, if the namespace alias is not recognized, the namespace URI returned will be
{@code "http://unknown/"} plus the alias, unless {@code errorO... | [
"Returns",
"the",
"namespace",
"URI",
"to",
"use",
"for",
"serialization",
"for",
"a",
"given",
"namespace",
"alias",
"possibly",
"using",
"a",
"predictable",
"made",
"-",
"up",
"namespace",
"URI",
"if",
"the",
"alias",
"is",
"not",
"recognized",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java#L288-L296 |
111,873 | googleapis/google-http-java-client | google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java | XmlNamespaceDictionary.getNamespaceAliasForUriErrorOnUnknown | String getNamespaceAliasForUriErrorOnUnknown(String namespaceUri) {
String result = getAliasForUri(namespaceUri);
Preconditions.checkArgument(
result != null,
"invalid XML: no alias declared for namesapce <%s>; "
+ "work-around by setting XML namepace directly by calling the set meth... | java | String getNamespaceAliasForUriErrorOnUnknown(String namespaceUri) {
String result = getAliasForUri(namespaceUri);
Preconditions.checkArgument(
result != null,
"invalid XML: no alias declared for namesapce <%s>; "
+ "work-around by setting XML namepace directly by calling the set meth... | [
"String",
"getNamespaceAliasForUriErrorOnUnknown",
"(",
"String",
"namespaceUri",
")",
"{",
"String",
"result",
"=",
"getAliasForUri",
"(",
"namespaceUri",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"result",
"!=",
"null",
",",
"\"invalid XML: no alias declar... | Returns the namespace alias to use for a given namespace URI, throwing an exception if the
namespace URI can be found in this dictionary.
@param namespaceUri namespace URI
@throws IllegalArgumentException if the namespace URI is not found in this dictionary | [
"Returns",
"the",
"namespace",
"alias",
"to",
"use",
"for",
"a",
"given",
"namespace",
"URI",
"throwing",
"an",
"exception",
"if",
"the",
"namespace",
"URI",
"can",
"be",
"found",
"in",
"this",
"dictionary",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client-xml/src/main/java/com/google/api/client/xml/XmlNamespaceDictionary.java#L305-L314 |
111,874 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/webtoken/JsonWebSignature.java | JsonWebSignature.verifySignature | public final boolean verifySignature(PublicKey publicKey) throws GeneralSecurityException {
Signature signatureAlg = null;
String algorithm = getHeader().getAlgorithm();
if ("RS256".equals(algorithm)) {
signatureAlg = SecurityUtils.getSha256WithRsaSignatureAlgorithm();
} else {
return false;... | java | public final boolean verifySignature(PublicKey publicKey) throws GeneralSecurityException {
Signature signatureAlg = null;
String algorithm = getHeader().getAlgorithm();
if ("RS256".equals(algorithm)) {
signatureAlg = SecurityUtils.getSha256WithRsaSignatureAlgorithm();
} else {
return false;... | [
"public",
"final",
"boolean",
"verifySignature",
"(",
"PublicKey",
"publicKey",
")",
"throws",
"GeneralSecurityException",
"{",
"Signature",
"signatureAlg",
"=",
"null",
";",
"String",
"algorithm",
"=",
"getHeader",
"(",
")",
".",
"getAlgorithm",
"(",
")",
";",
... | Verifies the signature of the content.
<p>Currently only {@code "RS256"} algorithm is verified, but others may be added in the future.
For any other algorithm it returns {@code false}.
@param publicKey public key
@return whether the algorithm is recognized and it is verified
@throws GeneralSecurityException | [
"Verifies",
"the",
"signature",
"of",
"the",
"content",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/webtoken/JsonWebSignature.java#L389-L398 |
111,875 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/DateTime.java | DateTime.appendInt | private static void appendInt(StringBuilder sb, int num, int numDigits) {
if (num < 0) {
sb.append('-');
num = -num;
}
int x = num;
while (x > 0) {
x /= 10;
numDigits--;
}
for (int i = 0; i < numDigits; i++) {
sb.append('0');
}
if (num != 0) {
sb.appen... | java | private static void appendInt(StringBuilder sb, int num, int numDigits) {
if (num < 0) {
sb.append('-');
num = -num;
}
int x = num;
while (x > 0) {
x /= 10;
numDigits--;
}
for (int i = 0; i < numDigits; i++) {
sb.append('0');
}
if (num != 0) {
sb.appen... | [
"private",
"static",
"void",
"appendInt",
"(",
"StringBuilder",
"sb",
",",
"int",
"num",
",",
"int",
"numDigits",
")",
"{",
"if",
"(",
"num",
"<",
"0",
")",
"{",
"sb",
".",
"append",
"(",
"'",
"'",
")",
";",
"num",
"=",
"-",
"num",
";",
"}",
"i... | Appends a zero-padded number to a string builder. | [
"Appends",
"a",
"zero",
"-",
"padded",
"number",
"to",
"a",
"string",
"builder",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/DateTime.java#L331-L347 |
111,876 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/PemReader.java | PemReader.readNextSection | public Section readNextSection(String titleToLookFor) throws IOException {
String title = null;
StringBuilder keyBuilder = null;
while (true) {
String line = reader.readLine();
if (line == null) {
Preconditions.checkArgument(title == null, "missing end tag (%s)", title);
return n... | java | public Section readNextSection(String titleToLookFor) throws IOException {
String title = null;
StringBuilder keyBuilder = null;
while (true) {
String line = reader.readLine();
if (line == null) {
Preconditions.checkArgument(title == null, "missing end tag (%s)", title);
return n... | [
"public",
"Section",
"readNextSection",
"(",
"String",
"titleToLookFor",
")",
"throws",
"IOException",
"{",
"String",
"title",
"=",
"null",
";",
"StringBuilder",
"keyBuilder",
"=",
"null",
";",
"while",
"(",
"true",
")",
"{",
"String",
"line",
"=",
"reader",
... | Reads the next section in the PEM file, optionally based on a title to look for.
@param titleToLookFor title to look for or {@code null} for any title
@return next section or {@code null} for end of file | [
"Reads",
"the",
"next",
"section",
"in",
"the",
"PEM",
"file",
"optionally",
"based",
"on",
"a",
"title",
"to",
"look",
"for",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/PemReader.java#L75-L104 |
111,877 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/PemReader.java | PemReader.readFirstSectionAndClose | public static Section readFirstSectionAndClose(Reader reader, String titleToLookFor)
throws IOException {
PemReader pemReader = new PemReader(reader);
try {
return pemReader.readNextSection(titleToLookFor);
} finally {
pemReader.close();
}
} | java | public static Section readFirstSectionAndClose(Reader reader, String titleToLookFor)
throws IOException {
PemReader pemReader = new PemReader(reader);
try {
return pemReader.readNextSection(titleToLookFor);
} finally {
pemReader.close();
}
} | [
"public",
"static",
"Section",
"readFirstSectionAndClose",
"(",
"Reader",
"reader",
",",
"String",
"titleToLookFor",
")",
"throws",
"IOException",
"{",
"PemReader",
"pemReader",
"=",
"new",
"PemReader",
"(",
"reader",
")",
";",
"try",
"{",
"return",
"pemReader",
... | Reads the first section in the PEM file, optionally based on a title to look for, and then
closes the reader.
@param titleToLookFor title to look for or {@code null} for any title
@param reader reader
@return first section found or {@code null} for none found | [
"Reads",
"the",
"first",
"section",
"in",
"the",
"PEM",
"file",
"optionally",
"based",
"on",
"a",
"title",
"to",
"look",
"for",
"and",
"then",
"closes",
"the",
"reader",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/PemReader.java#L124-L132 |
111,878 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java | FieldInfo.of | public static FieldInfo of(Enum<?> enumValue) {
try {
FieldInfo result = FieldInfo.of(enumValue.getClass().getField(enumValue.name()));
Preconditions.checkArgument(
result != null, "enum constant missing @Value or @NullValue annotation: %s", enumValue);
return result;
} catch (NoSuch... | java | public static FieldInfo of(Enum<?> enumValue) {
try {
FieldInfo result = FieldInfo.of(enumValue.getClass().getField(enumValue.name()));
Preconditions.checkArgument(
result != null, "enum constant missing @Value or @NullValue annotation: %s", enumValue);
return result;
} catch (NoSuch... | [
"public",
"static",
"FieldInfo",
"of",
"(",
"Enum",
"<",
"?",
">",
"enumValue",
")",
"{",
"try",
"{",
"FieldInfo",
"result",
"=",
"FieldInfo",
".",
"of",
"(",
"enumValue",
".",
"getClass",
"(",
")",
".",
"getField",
"(",
"enumValue",
".",
"name",
"(",
... | Returns the field information for the given enum value.
@param enumValue enum value
@return field information
@throws IllegalArgumentException if the enum value has no value annotation
@since 1.4 | [
"Returns",
"the",
"field",
"information",
"for",
"the",
"given",
"enum",
"value",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java#L49-L59 |
111,879 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java | FieldInfo.of | public static FieldInfo of(Field field) {
if (field == null) {
return null;
}
synchronized (CACHE) {
FieldInfo fieldInfo = CACHE.get(field);
boolean isEnumContant = field.isEnumConstant();
if (fieldInfo == null && (isEnumContant || !Modifier.isStatic(field.getModifiers()))) {
... | java | public static FieldInfo of(Field field) {
if (field == null) {
return null;
}
synchronized (CACHE) {
FieldInfo fieldInfo = CACHE.get(field);
boolean isEnumContant = field.isEnumConstant();
if (fieldInfo == null && (isEnumContant || !Modifier.isStatic(field.getModifiers()))) {
... | [
"public",
"static",
"FieldInfo",
"of",
"(",
"Field",
"field",
")",
"{",
"if",
"(",
"field",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"synchronized",
"(",
"CACHE",
")",
"{",
"FieldInfo",
"fieldInfo",
"=",
"CACHE",
".",
"get",
"(",
"field",
... | Returns the field information for the given field.
@param field field or {@code null} for {@code null} result
@return field information or {@code null} if the field has no {@link #name} or for {@code null}
input | [
"Returns",
"the",
"field",
"information",
"for",
"the",
"given",
"field",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java#L68-L110 |
111,880 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java | FieldInfo.settersMethodForField | private Method[] settersMethodForField(Field field) {
List<Method> methods = new ArrayList<>();
for (Method method : field.getDeclaringClass().getDeclaredMethods()) {
if (Ascii.toLowerCase(method.getName()).equals("set" + Ascii.toLowerCase(field.getName()))
&& method.getParameterTypes().length =... | java | private Method[] settersMethodForField(Field field) {
List<Method> methods = new ArrayList<>();
for (Method method : field.getDeclaringClass().getDeclaredMethods()) {
if (Ascii.toLowerCase(method.getName()).equals("set" + Ascii.toLowerCase(field.getName()))
&& method.getParameterTypes().length =... | [
"private",
"Method",
"[",
"]",
"settersMethodForField",
"(",
"Field",
"field",
")",
"{",
"List",
"<",
"Method",
">",
"methods",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"Method",
"method",
":",
"field",
".",
"getDeclaringClass",
"(",
")"... | Creates list of setter methods for a field only in declaring class. | [
"Creates",
"list",
"of",
"setter",
"methods",
"for",
"a",
"field",
"only",
"in",
"declaring",
"class",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java#L138-L147 |
111,881 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java | FieldInfo.setValue | public void setValue(Object obj, Object value) {
if (setters.length > 0) {
for (Method method : setters) {
if (value == null || method.getParameterTypes()[0].isAssignableFrom(value.getClass())) {
try {
method.invoke(obj, value);
return;
} catch (IllegalAcces... | java | public void setValue(Object obj, Object value) {
if (setters.length > 0) {
for (Method method : setters) {
if (value == null || method.getParameterTypes()[0].isAssignableFrom(value.getClass())) {
try {
method.invoke(obj, value);
return;
} catch (IllegalAcces... | [
"public",
"void",
"setValue",
"(",
"Object",
"obj",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"setters",
".",
"length",
">",
"0",
")",
"{",
"for",
"(",
"Method",
"method",
":",
"setters",
")",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"method... | Sets this field in the given object to the given value using reflection.
<p>If the field is final, it checks that the value being set is identical to the existing
value. | [
"Sets",
"this",
"field",
"in",
"the",
"given",
"object",
"to",
"the",
"given",
"value",
"using",
"reflection",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java#L219-L233 |
111,882 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java | FieldInfo.getFieldValue | public static Object getFieldValue(Field field, Object obj) {
try {
return field.get(obj);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException(e);
}
} | java | public static Object getFieldValue(Field field, Object obj) {
try {
return field.get(obj);
} catch (IllegalAccessException e) {
throw new IllegalArgumentException(e);
}
} | [
"public",
"static",
"Object",
"getFieldValue",
"(",
"Field",
"field",
",",
"Object",
"obj",
")",
"{",
"try",
"{",
"return",
"field",
".",
"get",
"(",
"obj",
")",
";",
"}",
"catch",
"(",
"IllegalAccessException",
"e",
")",
"{",
"throw",
"new",
"IllegalArg... | Returns the value of the given field in the given object using reflection. | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"field",
"in",
"the",
"given",
"object",
"using",
"reflection",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java#L246-L252 |
111,883 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java | FieldInfo.setFieldValue | public static void setFieldValue(Field field, Object obj, Object value) {
if (Modifier.isFinal(field.getModifiers())) {
Object finalValue = getFieldValue(field, obj);
if (value == null ? finalValue != null : !value.equals(finalValue)) {
throw new IllegalArgumentException(
"expected f... | java | public static void setFieldValue(Field field, Object obj, Object value) {
if (Modifier.isFinal(field.getModifiers())) {
Object finalValue = getFieldValue(field, obj);
if (value == null ? finalValue != null : !value.equals(finalValue)) {
throw new IllegalArgumentException(
"expected f... | [
"public",
"static",
"void",
"setFieldValue",
"(",
"Field",
"field",
",",
"Object",
"obj",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"Modifier",
".",
"isFinal",
"(",
"field",
".",
"getModifiers",
"(",
")",
")",
")",
"{",
"Object",
"finalValue",
"=",
... | Sets the given field in the given object to the given value using reflection.
<p>If the field is final, it checks that the value being set is identical to the existing
value. | [
"Sets",
"the",
"given",
"field",
"in",
"the",
"given",
"object",
"to",
"the",
"given",
"value",
"using",
"reflection",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/FieldInfo.java#L260-L283 |
111,884 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/store/FileDataStoreFactory.java | FileDataStoreFactory.setPermissionsToOwnerOnly | static void setPermissionsToOwnerOnly(File file) throws IOException {
// Disable access by other users if O/S allows it and set file permissions to readable and
// writable by user. Use reflection since JDK 1.5 will not have these methods
try {
Method setReadable = File.class.getMethod("setReadable", ... | java | static void setPermissionsToOwnerOnly(File file) throws IOException {
// Disable access by other users if O/S allows it and set file permissions to readable and
// writable by user. Use reflection since JDK 1.5 will not have these methods
try {
Method setReadable = File.class.getMethod("setReadable", ... | [
"static",
"void",
"setPermissionsToOwnerOnly",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"// Disable access by other users if O/S allows it and set file permissions to readable and",
"// writable by user. Use reflection since JDK 1.5 will not have these methods",
"try",
"{",
... | Attempts to set the given file's permissions such that it can only be read, written, and
executed by the file's owner.
@param file the file's permissions to modify
@throws IOException | [
"Attempts",
"to",
"set",
"the",
"given",
"file",
"s",
"permissions",
"such",
"that",
"it",
"can",
"only",
"be",
"read",
"written",
"and",
"executed",
"by",
"the",
"file",
"s",
"owner",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/store/FileDataStoreFactory.java#L119-L153 |
111,885 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Data.java | Data.isNull | public static boolean isNull(Object object) {
// don't call nullOf because will throw IllegalArgumentException if cannot create instance
return object != null && object == NULL_CACHE.get(object.getClass());
} | java | public static boolean isNull(Object object) {
// don't call nullOf because will throw IllegalArgumentException if cannot create instance
return object != null && object == NULL_CACHE.get(object.getClass());
} | [
"public",
"static",
"boolean",
"isNull",
"(",
"Object",
"object",
")",
"{",
"// don't call nullOf because will throw IllegalArgumentException if cannot create instance",
"return",
"object",
"!=",
"null",
"&&",
"object",
"==",
"NULL_CACHE",
".",
"get",
"(",
"object",
".",
... | Returns whether the given object is the magic object that represents the null value of its
class.
@param object object or {@code null}
@return whether it is the magic null value or {@code false} for {@code null} input | [
"Returns",
"whether",
"the",
"given",
"object",
"is",
"the",
"magic",
"object",
"that",
"represents",
"the",
"null",
"value",
"of",
"its",
"class",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Data.java#L154-L157 |
111,886 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Data.java | Data.mapOf | public static Map<String, Object> mapOf(Object data) {
if (data == null || isNull(data)) {
return Collections.emptyMap();
}
if (data instanceof Map<?, ?>) {
@SuppressWarnings("unchecked")
Map<String, Object> result = (Map<String, Object>) data;
return result;
}
Map<String, Ob... | java | public static Map<String, Object> mapOf(Object data) {
if (data == null || isNull(data)) {
return Collections.emptyMap();
}
if (data instanceof Map<?, ?>) {
@SuppressWarnings("unchecked")
Map<String, Object> result = (Map<String, Object>) data;
return result;
}
Map<String, Ob... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"mapOf",
"(",
"Object",
"data",
")",
"{",
"if",
"(",
"data",
"==",
"null",
"||",
"isNull",
"(",
"data",
")",
")",
"{",
"return",
"Collections",
".",
"emptyMap",
"(",
")",
";",
"}",
"if",... | Returns the map to use for the given data that is treated as a map from string key to some
value.
<p>If the input is {@code null}, it returns an empty map. If the input is a map, it simply
returns the input. Otherwise, it will create a map view using reflection that is backed by the
object, so that any changes to the ... | [
"Returns",
"the",
"map",
"to",
"use",
"for",
"the",
"given",
"data",
"that",
"is",
"treated",
"as",
"a",
"map",
"from",
"string",
"key",
"to",
"some",
"value",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Data.java#L176-L187 |
111,887 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Data.java | Data.parsePrimitiveValue | public static Object parsePrimitiveValue(Type type, String stringValue) {
Class<?> primitiveClass = type instanceof Class<?> ? (Class<?>) type : null;
if (type == null || primitiveClass != null) {
if (primitiveClass == Void.class) {
return null;
}
if (stringValue == null
|| p... | java | public static Object parsePrimitiveValue(Type type, String stringValue) {
Class<?> primitiveClass = type instanceof Class<?> ? (Class<?>) type : null;
if (type == null || primitiveClass != null) {
if (primitiveClass == Void.class) {
return null;
}
if (stringValue == null
|| p... | [
"public",
"static",
"Object",
"parsePrimitiveValue",
"(",
"Type",
"type",
",",
"String",
"stringValue",
")",
"{",
"Class",
"<",
"?",
">",
"primitiveClass",
"=",
"type",
"instanceof",
"Class",
"<",
"?",
">",
"?",
"(",
"Class",
"<",
"?",
">",
")",
"type",
... | Parses the given string value based on the given primitive type.
<p>Types are parsed as follows:
<ul>
<li>{@link Void}: null
<li>{@code null} or is assignable from {@link String} (like {@link Object}): no parsing
<li>{@code char} or {@link Character}: {@link String#charAt(int) String.charAt}(0) (requires
length to be... | [
"Parses",
"the",
"given",
"string",
"value",
"based",
"on",
"the",
"given",
"primitive",
"type",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Data.java#L398-L457 |
111,888 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Data.java | Data.newCollectionInstance | public static Collection<Object> newCollectionInstance(Type type) {
if (type instanceof WildcardType) {
type = Types.getBound((WildcardType) type);
}
if (type instanceof ParameterizedType) {
type = ((ParameterizedType) type).getRawType();
}
Class<?> collectionClass = type instanceof Clas... | java | public static Collection<Object> newCollectionInstance(Type type) {
if (type instanceof WildcardType) {
type = Types.getBound((WildcardType) type);
}
if (type instanceof ParameterizedType) {
type = ((ParameterizedType) type).getRawType();
}
Class<?> collectionClass = type instanceof Clas... | [
"public",
"static",
"Collection",
"<",
"Object",
">",
"newCollectionInstance",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"WildcardType",
")",
"{",
"type",
"=",
"Types",
".",
"getBound",
"(",
"(",
"WildcardType",
")",
"type",
")",
";",... | Returns a new collection instance for the given type.
<p>Creates a new collection instance specified for the first input collection class that
matches as follows:
<ul>
<li>{@code null} or an array or assignable from {@link ArrayList} (like {@link List} or
{@link Collection} or {@link Object}): returns an {@link Array... | [
"Returns",
"a",
"new",
"collection",
"instance",
"for",
"the",
"given",
"type",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Data.java#L477-L503 |
111,889 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Data.java | Data.newMapInstance | public static Map<String, Object> newMapInstance(Class<?> mapClass) {
if (mapClass == null || mapClass.isAssignableFrom(ArrayMap.class)) {
return ArrayMap.create();
}
if (mapClass.isAssignableFrom(TreeMap.class)) {
return new TreeMap<String, Object>();
}
@SuppressWarnings("unchecked")
... | java | public static Map<String, Object> newMapInstance(Class<?> mapClass) {
if (mapClass == null || mapClass.isAssignableFrom(ArrayMap.class)) {
return ArrayMap.create();
}
if (mapClass.isAssignableFrom(TreeMap.class)) {
return new TreeMap<String, Object>();
}
@SuppressWarnings("unchecked")
... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"newMapInstance",
"(",
"Class",
"<",
"?",
">",
"mapClass",
")",
"{",
"if",
"(",
"mapClass",
"==",
"null",
"||",
"mapClass",
".",
"isAssignableFrom",
"(",
"ArrayMap",
".",
"class",
")",
")",
... | Returns a new instance of a map based on the given field class.
<p>Creates a new map instance specified for the first input map class that matches as follows:
<ul>
<li>{@code null} or assignable from {@link ArrayMap} (like {@link Map} or {@link Object}):
returns an {@link ArrayMap}
<li>assignable from {@link TreeMap}... | [
"Returns",
"a",
"new",
"instance",
"of",
"a",
"map",
"based",
"on",
"the",
"given",
"field",
"class",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Data.java#L520-L530 |
111,890 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/OpenCensusUtils.java | OpenCensusUtils.propagateTracingContext | public static void propagateTracingContext(Span span, HttpHeaders headers) {
Preconditions.checkArgument(span != null, "span should not be null.");
Preconditions.checkArgument(headers != null, "headers should not be null.");
if (propagationTextFormat != null && propagationTextFormatSetter != null) {
i... | java | public static void propagateTracingContext(Span span, HttpHeaders headers) {
Preconditions.checkArgument(span != null, "span should not be null.");
Preconditions.checkArgument(headers != null, "headers should not be null.");
if (propagationTextFormat != null && propagationTextFormatSetter != null) {
i... | [
"public",
"static",
"void",
"propagateTracingContext",
"(",
"Span",
"span",
",",
"HttpHeaders",
"headers",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"span",
"!=",
"null",
",",
"\"span should not be null.\"",
")",
";",
"Preconditions",
".",
"checkArgument... | Propagate information of current tracing context. This information will be injected into HTTP
header.
@param span the span to be propagated.
@param headers the headers used in propagation. | [
"Propagate",
"information",
"of",
"current",
"tracing",
"context",
".",
"This",
"information",
"will",
"be",
"injected",
"into",
"HTTP",
"header",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/OpenCensusUtils.java#L132-L140 |
111,891 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpRequestFactory.java | HttpRequestFactory.buildRequest | public HttpRequest buildRequest(String requestMethod, GenericUrl url, HttpContent content)
throws IOException {
HttpRequest request = transport.buildRequest();
if (initializer != null) {
initializer.initialize(request);
}
request.setRequestMethod(requestMethod);
if (url != null) {
... | java | public HttpRequest buildRequest(String requestMethod, GenericUrl url, HttpContent content)
throws IOException {
HttpRequest request = transport.buildRequest();
if (initializer != null) {
initializer.initialize(request);
}
request.setRequestMethod(requestMethod);
if (url != null) {
... | [
"public",
"HttpRequest",
"buildRequest",
"(",
"String",
"requestMethod",
",",
"GenericUrl",
"url",
",",
"HttpContent",
"content",
")",
"throws",
"IOException",
"{",
"HttpRequest",
"request",
"=",
"transport",
".",
"buildRequest",
"(",
")",
";",
"if",
"(",
"initi... | Builds a request for the given HTTP method, URL, and content.
@param requestMethod HTTP request method
@param url HTTP request URL or {@code null} for none
@param content HTTP request content or {@code null} for none
@return new HTTP request
@since 1.12 | [
"Builds",
"a",
"request",
"for",
"the",
"given",
"HTTP",
"method",
"URL",
"and",
"content",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpRequestFactory.java#L84-L98 |
111,892 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java | HttpResponse.getContent | public InputStream getContent() throws IOException {
if (!contentRead) {
InputStream lowLevelResponseContent = this.response.getContent();
if (lowLevelResponseContent != null) {
// Flag used to indicate if an exception is thrown before the content is successfully
// processed.
bo... | java | public InputStream getContent() throws IOException {
if (!contentRead) {
InputStream lowLevelResponseContent = this.response.getContent();
if (lowLevelResponseContent != null) {
// Flag used to indicate if an exception is thrown before the content is successfully
// processed.
bo... | [
"public",
"InputStream",
"getContent",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"contentRead",
")",
"{",
"InputStream",
"lowLevelResponseContent",
"=",
"this",
".",
"response",
".",
"getContent",
"(",
")",
";",
"if",
"(",
"lowLevelResponseContent"... | Returns the content of the HTTP response.
<p>The result is cached, so subsequent calls will be fast.
<p>Callers should call {@link InputStream#close} after the returned {@link InputStream} is no
longer needed. Example usage:
<pre>
InputStream is = response.getContent();
try {
// Process the input stream..
} finally ... | [
"Returns",
"the",
"content",
"of",
"the",
"HTTP",
"response",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java#L321-L357 |
111,893 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java | HttpResponse.download | public void download(OutputStream outputStream) throws IOException {
InputStream inputStream = getContent();
IOUtils.copy(inputStream, outputStream);
} | java | public void download(OutputStream outputStream) throws IOException {
InputStream inputStream = getContent();
IOUtils.copy(inputStream, outputStream);
} | [
"public",
"void",
"download",
"(",
"OutputStream",
"outputStream",
")",
"throws",
"IOException",
"{",
"InputStream",
"inputStream",
"=",
"getContent",
"(",
")",
";",
"IOUtils",
".",
"copy",
"(",
"inputStream",
",",
"outputStream",
")",
";",
"}"
] | Writes the content of the HTTP response into the given destination output stream.
<p>Sample usage:
<pre>
HttpRequest request = requestFactory.buildGetRequest(
new GenericUrl("https://www.google.com/images/srpr/logo3w.png"));
OutputStream outputStream = new FileOutputStream(new File("/tmp/logo3w.png"));
try {
HttpResp... | [
"Writes",
"the",
"content",
"of",
"the",
"HTTP",
"response",
"into",
"the",
"given",
"destination",
"output",
"stream",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/http/HttpResponse.java#L384-L387 |
111,894 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java | SecurityUtils.loadKeyStore | public static void loadKeyStore(KeyStore keyStore, InputStream keyStream, String storePass)
throws IOException, GeneralSecurityException {
try {
keyStore.load(keyStream, storePass.toCharArray());
} finally {
keyStream.close();
}
} | java | public static void loadKeyStore(KeyStore keyStore, InputStream keyStream, String storePass)
throws IOException, GeneralSecurityException {
try {
keyStore.load(keyStream, storePass.toCharArray());
} finally {
keyStream.close();
}
} | [
"public",
"static",
"void",
"loadKeyStore",
"(",
"KeyStore",
"keyStore",
",",
"InputStream",
"keyStream",
",",
"String",
"storePass",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"{",
"try",
"{",
"keyStore",
".",
"load",
"(",
"keyStream",
",",
... | Loads a key store from a stream.
<p>Example usage:
<pre>
KeyStore keyStore = SecurityUtils.getJavaKeyStore();
SecurityUtils.loadKeyStore(keyStore, new FileInputStream("certs.jks"), "password");
</pre>
@param keyStore key store
@param keyStream input stream to the key store stream (closed at the end of this method in... | [
"Loads",
"a",
"key",
"store",
"from",
"a",
"stream",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java#L75-L82 |
111,895 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java | SecurityUtils.getPrivateKey | public static PrivateKey getPrivateKey(KeyStore keyStore, String alias, String keyPass)
throws GeneralSecurityException {
return (PrivateKey) keyStore.getKey(alias, keyPass.toCharArray());
} | java | public static PrivateKey getPrivateKey(KeyStore keyStore, String alias, String keyPass)
throws GeneralSecurityException {
return (PrivateKey) keyStore.getKey(alias, keyPass.toCharArray());
} | [
"public",
"static",
"PrivateKey",
"getPrivateKey",
"(",
"KeyStore",
"keyStore",
",",
"String",
"alias",
",",
"String",
"keyPass",
")",
"throws",
"GeneralSecurityException",
"{",
"return",
"(",
"PrivateKey",
")",
"keyStore",
".",
"getKey",
"(",
"alias",
",",
"key... | Returns the private key from the key store.
@param keyStore key store
@param alias alias under which the key is stored
@param keyPass password protecting the key
@return private key | [
"Returns",
"the",
"private",
"key",
"from",
"the",
"key",
"store",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java#L92-L95 |
111,896 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java | SecurityUtils.loadPrivateKeyFromKeyStore | public static PrivateKey loadPrivateKeyFromKeyStore(
KeyStore keyStore, InputStream keyStream, String storePass, String alias, String keyPass)
throws IOException, GeneralSecurityException {
loadKeyStore(keyStore, keyStream, storePass);
return getPrivateKey(keyStore, alias, keyPass);
} | java | public static PrivateKey loadPrivateKeyFromKeyStore(
KeyStore keyStore, InputStream keyStream, String storePass, String alias, String keyPass)
throws IOException, GeneralSecurityException {
loadKeyStore(keyStore, keyStream, storePass);
return getPrivateKey(keyStore, alias, keyPass);
} | [
"public",
"static",
"PrivateKey",
"loadPrivateKeyFromKeyStore",
"(",
"KeyStore",
"keyStore",
",",
"InputStream",
"keyStream",
",",
"String",
"storePass",
",",
"String",
"alias",
",",
"String",
"keyPass",
")",
"throws",
"IOException",
",",
"GeneralSecurityException",
"... | Retrieves a private key from the specified key store stream and specified key store.
@param keyStore key store
@param keyStream input stream to the key store (closed at the end of this method in a finally
block)
@param storePass password protecting the key store file
@param alias alias under which the key is stored
@p... | [
"Retrieves",
"a",
"private",
"key",
"from",
"the",
"specified",
"key",
"store",
"stream",
"and",
"specified",
"key",
"store",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java#L108-L113 |
111,897 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java | SecurityUtils.sign | public static byte[] sign(
Signature signatureAlgorithm, PrivateKey privateKey, byte[] contentBytes)
throws InvalidKeyException, SignatureException {
signatureAlgorithm.initSign(privateKey);
signatureAlgorithm.update(contentBytes);
return signatureAlgorithm.sign();
} | java | public static byte[] sign(
Signature signatureAlgorithm, PrivateKey privateKey, byte[] contentBytes)
throws InvalidKeyException, SignatureException {
signatureAlgorithm.initSign(privateKey);
signatureAlgorithm.update(contentBytes);
return signatureAlgorithm.sign();
} | [
"public",
"static",
"byte",
"[",
"]",
"sign",
"(",
"Signature",
"signatureAlgorithm",
",",
"PrivateKey",
"privateKey",
",",
"byte",
"[",
"]",
"contentBytes",
")",
"throws",
"InvalidKeyException",
",",
"SignatureException",
"{",
"signatureAlgorithm",
".",
"initSign",... | Signs content using a private key.
@param signatureAlgorithm signature algorithm
@param privateKey private key
@param contentBytes content to sign
@return signed content | [
"Signs",
"content",
"using",
"a",
"private",
"key",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java#L138-L144 |
111,898 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java | SecurityUtils.verify | public static boolean verify(
Signature signatureAlgorithm, PublicKey publicKey, byte[] signatureBytes, byte[] contentBytes)
throws InvalidKeyException, SignatureException {
signatureAlgorithm.initVerify(publicKey);
signatureAlgorithm.update(contentBytes);
// SignatureException may be thrown if ... | java | public static boolean verify(
Signature signatureAlgorithm, PublicKey publicKey, byte[] signatureBytes, byte[] contentBytes)
throws InvalidKeyException, SignatureException {
signatureAlgorithm.initVerify(publicKey);
signatureAlgorithm.update(contentBytes);
// SignatureException may be thrown if ... | [
"public",
"static",
"boolean",
"verify",
"(",
"Signature",
"signatureAlgorithm",
",",
"PublicKey",
"publicKey",
",",
"byte",
"[",
"]",
"signatureBytes",
",",
"byte",
"[",
"]",
"contentBytes",
")",
"throws",
"InvalidKeyException",
",",
"SignatureException",
"{",
"s... | Verifies the signature of signed content based on a public key.
@param signatureAlgorithm signature algorithm
@param publicKey public key
@param signatureBytes signature bytes
@param contentBytes content bytes
@return whether the signature was verified | [
"Verifies",
"the",
"signature",
"of",
"signed",
"content",
"based",
"on",
"a",
"public",
"key",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java#L155-L166 |
111,899 | googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java | SecurityUtils.verify | public static X509Certificate verify(
Signature signatureAlgorithm,
X509TrustManager trustManager,
List<String> certChainBase64,
byte[] signatureBytes,
byte[] contentBytes)
throws InvalidKeyException, SignatureException {
CertificateFactory certificateFactory;
try {
cer... | java | public static X509Certificate verify(
Signature signatureAlgorithm,
X509TrustManager trustManager,
List<String> certChainBase64,
byte[] signatureBytes,
byte[] contentBytes)
throws InvalidKeyException, SignatureException {
CertificateFactory certificateFactory;
try {
cer... | [
"public",
"static",
"X509Certificate",
"verify",
"(",
"Signature",
"signatureAlgorithm",
",",
"X509TrustManager",
"trustManager",
",",
"List",
"<",
"String",
">",
"certChainBase64",
",",
"byte",
"[",
"]",
"signatureBytes",
",",
"byte",
"[",
"]",
"contentBytes",
")... | Verifies the signature of signed content based on a certificate chain.
@param signatureAlgorithm signature algorithm
@param trustManager trust manager used to verify the certificate chain
@param certChainBase64 Certificate chain used for verification. The certificates must be base64
encoded DER, the leaf certificate m... | [
"Verifies",
"the",
"signature",
"of",
"signed",
"content",
"based",
"on",
"a",
"certificate",
"chain",
"."
] | 0988ae4e0f26a80f579b6adb2b276dd8254928de | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/SecurityUtils.java#L180-L218 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.