id stringlengths 7 14 | text stringlengths 1 106k |
|---|---|
293812_10 | public boolean evaluate(Collection<Tag> tags) {
return and.isEmpty() || and.eval(tags);
} |
293812_11 | public boolean evaluate(Collection<Tag> tags) {
return and.isEmpty() || and.eval(tags);
} |
2945916_0 | public Iterator<CharBufferWrapper> iterator() {
return new MessageIterator();
} |
2945916_1 | public String getMimeType() {
return mimeType;
} |
2945916_2 | public long getContentLength() {
ContentLengthField contentLengthField = (ContentLengthField) fields.get(CONTENT_LENGTH);
return contentLengthField != null ? contentLengthField.getContentLength() : -1;
} |
2945916_3 | public String getMimeType() {
return mimeType;
} |
2945916_4 | public String getCharset() {
return charset;
} |
2945916_5 | public String getCharset() {
return charset;
} |
2945916_6 | public String getContentDispositionType() {
ContentDispositionField contentDispositionField =
(ContentDispositionField) fields.get(CONTENT_DISPOSITION);
return contentDispositionField != null ? contentDispositionField.getDispositionType() : null;
} |
2945916_7 | public List<String> getContentLanguage() {
ContentLanguageField contentLanguageField =
(ContentLanguageField) fields.get(CONTENT_LANGUAGE);
return contentLanguageField != null ? contentLanguageField.getLanguages() :
Collections.<String>emptyList();
} |
2945916_8 | public String getContentLocation() {
ContentLocationField contentLocationField =
(ContentLocationField) fields.get(CONTENT_LOCATION);
return contentLocationField != null ? contentLocationField.getLocation() : null;
} |
2945916_9 | public String getContentLocation() {
ContentLocationField contentLocationField =
(ContentLocationField) fields.get(CONTENT_LOCATION);
return contentLocationField != null ? contentLocationField.getLocation() : null;
} |
2948043_0 | @Override
public synchronized void clear() {
delegate = Collections.emptyMap();
} |
2948043_1 | @Override
public Set<Entry<K, V>> entrySet() {
return delegate.entrySet();
} |
2948043_2 | @Override
public synchronized V put(K key, V value) {
return putInternal(key, value);
} |
2948043_3 | @Override
public synchronized void putAll(Map<? extends K, ? extends V> m) {
final Map<K, V> delegate = new HashMap<>(this.delegate);
for(Entry<? extends K, ? extends V> e : m.entrySet()) {
delegate.put(e.getKey(), e.getValue());
}
this.delegate = delegate;
} |
2948043_4 | @Override
public Mono<?> fromCompletionStage(final CompletionStage<?> completionStage)
{
return Mono.fromFuture(completionStage.toCompletableFuture());
} |
2948043_5 | @Override
public Mono<?> fromCompletionStage(final CompletionStage<?> completionStage)
{
return Mono.fromFuture(completionStage.toCompletableFuture());
} |
2948043_6 | @Override
public Mono<?> fromCompletionStage(final CompletionStage<?> completionStage)
{
return Mono.fromFuture(completionStage.toCompletableFuture());
} |
2948043_7 | @Override
public CompletionStage<?> toCompletionStage(final Mono<?> asyncResponse)
{
return asyncResponse.toFuture();
} |
2948043_8 | static RuntimeException clientException(Throwable ex, Response clientResponse) {
RuntimeException ret;
if (ex == null) {
ret = new ProcessingException(new NullPointerException());
} else if (ex instanceof WebApplicationException) {
ret = (WebApplicationException) ex;
} else if (ex instan... |
2948043_9 | static RuntimeException clientException(Throwable ex, Response clientResponse) {
RuntimeException ret;
if (ex == null) {
ret = new ProcessingException(new NullPointerException());
} else if (ex instanceof WebApplicationException) {
ret = (WebApplicationException) ex;
} else if (ex instan... |
2964129_0 | public static String encodeDisconnect() {
return "" + FrameType.DISCONNECT.value();
} |
2964129_1 | public static String encodeDisconnect() {
return "" + FrameType.DISCONNECT.value();
} |
2964129_2 | public static String encodeConnect() {
return SocketIOFrameGenerator.encode(FrameType.CONNECT, SocketIOFrame.EMPTY_FIELD, false, null, null, null);
} |
2964129_3 | public static String encodeConnect() {
return SocketIOFrameGenerator.encode(FrameType.CONNECT, SocketIOFrame.EMPTY_FIELD, false, null, null, null);
} |
2964129_4 | public static String encodeConnect() {
return SocketIOFrameGenerator.encode(FrameType.CONNECT, SocketIOFrame.EMPTY_FIELD, false, null, null, null);
} |
2964129_5 | public static String encodeHeartBit() {
return SocketIOFrameGenerator.encode(FrameType.HEARTBEAT, SocketIOFrame.EMPTY_FIELD, false, null, null, null);
} |
2964129_6 | public static String encodeAck(final long msgID, final long ackID, final String data) {
final String _ackID = ((ackID == SocketIOFrame.EMPTY_FIELD) || (ackID < 0)) ? null : String.valueOf(ackID);
return SocketIOFrameGenerator.encode(FrameType.ACK, msgID, false, null, _ackID, data);
} |
2964129_7 | public static String encodeError(final String reason, final String advice) {
return SocketIOFrameGenerator.encode(FrameType.ERROR, SocketIOFrame.EMPTY_FIELD, false, null, reason, advice);
} |
2964129_8 | public static String encodeMessage(final long messageID, final String endPoint, final String data) {
return SocketIOFrameGenerator.encode(FrameType.MESSAGE, messageID, false, endPoint, data, null);
} |
2964129_9 | public static String encodeJSONMessage(final long messageID, final String endPoint, final String data) {
return SocketIOFrameGenerator.encode(FrameType.JSON, messageID, false, endPoint, data, null);
} |
2974683_0 | @Override
public synchronized int read(long pos, byte[] b, int start, int len)
throws IOException {
this.pos = (int)pos;
return read(b, start, len);
} |
2978404_0 | public static List<Parameter> allOf(Method method) {
final List<Parameter> list = new ArrayList<Parameter>();
for (int i = 0; i < method.getParameterTypes().length; i++) {
list.add(new Parameter(method, i));
}
return Collections.unmodifiableList(list);
} |
2978404_1 | @Override
public String get(Parameter parameter) {
if (parameter.isAnnotationPresent(JmsName.class))
return parameter.getAnnotation(JmsName.class).value();
return delegate.get(parameter);
} |
2978404_2 | public Mapping build() {
Mapping result = mapping;
if (fieldMap != null)
result = new MapFieldsMapping(result, fieldMap);
if (opMap != null)
result = new MapOperationsMapping(result, opMap);
return new CheckedMapping(result);
} |
2978404_3 | public void scan(Object object) {
try {
scan(object, "", false, new ArrayList<Object>());
} catch (JMSException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} |
2978404_4 | public void scan(Object object) {
try {
scan(object, "", false, new ArrayList<Object>());
} catch (JMSException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} |
2978404_5 | public void scan(Object object) {
try {
scan(object, "", false, new ArrayList<Object>());
} catch (JMSException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} |
2978404_6 | public void scan(Object object) {
try {
scan(object, "", false, new ArrayList<Object>());
} catch (JMSException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} |
2978404_7 | public void scan(Object object) {
try {
scan(object, "", false, new ArrayList<Object>());
} catch (JMSException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} |
2978404_8 | public void scan(Object object) {
try {
scan(object, "", false, new ArrayList<Object>());
} catch (JMSException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} |
2978404_9 | public void scan(Object object) {
try {
scan(object, "", false, new ArrayList<Object>());
} catch (JMSException e) {
throw new RuntimeException(e);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
} |
298328_10 | public static String render(final String input) throws IllegalArgumentException {
try {
return render(input, new StringBuilder(input.length())).toString();
} catch (IOException e) {
// Cannot happen because StringBuilder does not throw IOException
throw new IllegalArgumentException(e);
... |
298328_11 | public static String render(final String input) throws IllegalArgumentException {
try {
return render(input, new StringBuilder(input.length())).toString();
} catch (IOException e) {
// Cannot happen because StringBuilder does not throw IOException
throw new IllegalArgumentException(e);
... |
298328_12 | public static String render(final String input) throws IllegalArgumentException {
try {
return render(input, new StringBuilder(input.length())).toString();
} catch (IOException e) {
// Cannot happen because StringBuilder does not throw IOException
throw new IllegalArgumentException(e);
... |
298328_13 | public static void setEnabled(final boolean flag) {
holder.set(flag);
} |
2988101_0 | @GET
@Path("configuration")
public Response getConfiguration() {
File configurationFolder = Environment.getDefault().getConfig();
File configurationFile = new File(configurationFolder, NUXEO_DRIVE_CONFIGURATION_FILE);
if (!configurationFile.exists()) {
throw new WebResourceNotFoundException("Nuxeo D... |
2988101_1 | @Override
public List<Class<?>> getManagedClasses() {
if (managedClasses == null) {
managedClasses = new ArrayList<>();
if (includingUsers) {
managedClasses.add(NuxeoPrincipal.class);
}
if (includingGroups) {
managedClasses.add(NuxeoGroup.class);
}
... |
2988101_2 | @Override
public Object fetch(Object value) throws IllegalStateException {
checkConfig();
if (value instanceof String) {
String name = (String) value;
boolean userPrefix = name.startsWith(NuxeoPrincipal.PREFIX);
boolean groupPrefix = name.startsWith(NuxeoGroup.PREFIX);
if (includ... |
2988101_3 | @Override
public Object fetch(Object value) throws IllegalStateException {
checkConfig();
if (value instanceof String) {
String name = (String) value;
boolean userPrefix = name.startsWith(NuxeoPrincipal.PREFIX);
boolean groupPrefix = name.startsWith(NuxeoGroup.PREFIX);
if (includ... |
2988101_4 | @Override
public Serializable getReference(Object entity) throws IllegalStateException {
checkConfig();
if (entity != null) {
if (entity instanceof NuxeoPrincipal && includingUsers) {
return NuxeoPrincipal.PREFIX + ((NuxeoPrincipal) entity).getName();
} else if (entity instanceof Nux... |
2988101_5 | @Override
public String getConstraintErrorMessage(Object invalidValue, Locale locale) throws IllegalStateException {
checkConfig();
if (isIncludingUsers() && isIncludingGroups()) {
return Helper.getConstraintErrorMessage(this, "any", invalidValue, locale);
} else if (!isIncludingUsers() && isIncludi... |
2988101_6 | @Override
public void configure(Map<String, String> parameters) throws IllegalStateException {
super.configure(parameters);
if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) {
includingGroups = false;
} else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) {
includingUs... |
2988101_7 | @Override
public void configure(Map<String, String> parameters) throws IllegalStateException {
super.configure(parameters);
if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) {
includingGroups = false;
} else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) {
includingUs... |
2988101_8 | @Override
public void configure(Map<String, String> parameters) throws IllegalStateException {
super.configure(parameters);
if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) {
includingGroups = false;
} else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) {
includingUs... |
2988101_9 | @Override
public void configure(Map<String, String> parameters) throws IllegalStateException {
super.configure(parameters);
if (FILTER_USER.equals(parameters.get(INPUT_PARAM_FILTER))) {
includingGroups = false;
} else if (FILTER_GROUP.equals(parameters.get(INPUT_PARAM_FILTER))) {
includingUs... |
2988709_0 | @SuppressWarnings("unchecked")
protected List<DocumentModel> getDomainsFiltered() throws ClientException {
PageProviderService pps;
try {
pps = Framework.getService(PageProviderService.class);
} catch (Exception e) {
log.error("Failed to get PageProviderService", e);
return new Array... |
2988709_1 | protected void setOptions(Map<String, String> options) {
for (Entry<String, String> option : options.entrySet()) {
String key = option.getKey();
String type = option.getValue();
if (key.equals(OPTION_DOCTYPE)) {
SchemaManager sm = Framework.getLocalService(SchemaManager.class);
... |
2988709_2 | @Override
public void add(Statement statement) {
add(Collections.singletonList(statement));
} |
2988709_3 | @Override
public void remove(Statement statement) {
remove(Collections.singletonList(statement));
} |
2988709_4 | @Override
public List<Statement> getStatements() {
return getStatements(ALL);
} |
2988709_5 | @Override
public List<Node> getSubjects(Node predicate, Node object) {
List<Statement> statements = getStatements(new StatementImpl(null,
predicate, object));
List<Node> nodes = new ArrayList<Node>(statements.size());
for (Statement statement : statements) {
nodes.add(statement.getSubjec... |
2988709_6 | @Override
public List<Node> getPredicates(Node subject, Node object) {
List<Statement> statements = getStatements(new StatementImpl(subject,
null, object));
List<Node> nodes = new ArrayList<Node>(statements.size());
for (Statement statement : statements) {
nodes.add(statement.getPredicat... |
2988709_7 | @Override
public boolean hasStatement(Statement statement) {
if (statement == null) {
return false;
}
// could be optimized in the null/blank case, but this method seems
// unused
return !getStatements(statement).isEmpty();
} |
2988709_8 | @Override
public boolean hasResource(Resource resource) {
if (resource == null) {
return false;
}
ResourceFinder resourceFinder = session == null ? new ResourceFinder(
resource) : new ResourceFinder(resource, session);
try {
resourceFinder.runUnrestricted();
} catch (Clie... |
2988709_9 | @Override
public Long size() {
SizeFinder sizeFinder = session == null ? new SizeFinder()
: new SizeFinder(session);
try {
sizeFinder.runUnrestricted();
} catch (ClientException e) {
throw new RuntimeException(e);
}
return Long.valueOf(sizeFinder.size);
} |
2988715_0 | public static List<String> getCommonSchemas(List<DocumentModel> docs) {
List<String> schemas = null;
for (DocumentModel doc : docs) {
List<String> docSchemas = Arrays.asList(doc.getSchemas());
if (schemas == null) {
// first document
schemas = new ArrayList<String>();
... |
2988715_1 | public static List<String> getCommonLayouts(TypeManager typeManager,
List<DocumentModel> docs) {
return getCommonLayouts(typeManager, docs, BuiltinModes.EDIT);
} |
2988715_2 | @Deprecated
protected static List<String> getPropertiesToCopy(DocumentModel sourceDoc) {
List<String> propertiesToCopy = new ArrayList<String>();
for (Map.Entry<String, Serializable> entry : sourceDoc.getContextData().entrySet()) {
String key = entry.getKey();
if (key.startsWith(BULK_EDIT_PREFIX... |
2988715_3 | @Deprecated
public static void copyMetadata(CoreSession session,
DocumentModel sourceDoc, List<DocumentModel> targetDocs)
throws ClientException {
Framework.getLocalService(BulkEditService.class).updateDocuments(session,
sourceDoc, targetDocs);
} |
2988715_4 | public List<NavTreeDescriptor> getTreeDescriptors() {
return registry.getTreeDescriptors(getDirectoryTreeService());
} |
2988715_5 | protected void saveFileToDocument(String filename, DocumentModel dm,
String blobPropertyName, String filenamePropertyName, InputStream is)
throws IOException, PropertyException, ClientException {
// persisting the blob makes it possible to read the binary content
// of the request stream several... |
2988715_6 | protected void saveFileToDocument(String filename, DocumentModel dm,
String blobPropertyName, String filenamePropertyName, InputStream is)
throws IOException, PropertyException, ClientException {
// persisting the blob makes it possible to read the binary content
// of the request stream several... |
2988715_7 | public static String getDocumentUrl(RepositoryLocation serverLocation,
DocumentRef docRef) {
if (serverLocation == null) {
String nullRepoName = null;
return getDocumentUrl(nullRepoName, docRef);
}
return getDocumentUrl(serverLocation.getName(), docRef);
} |
2988715_8 | public static String getDocumentUrl(RepositoryLocation serverLocation,
DocumentRef docRef) {
if (serverLocation == null) {
String nullRepoName = null;
return getDocumentUrl(nullRepoName, docRef);
}
return getDocumentUrl(serverLocation.getName(), docRef);
} |
2988715_9 | public static String getFullDocumentUrl(RepositoryLocation serverLocation,
DocumentRef docRef) {
String baseUrl = BaseURL.getBaseURL();
String docUrl = getDocumentUrl(serverLocation, docRef);
if (baseUrl != null) {
return baseUrl + docUrl;
}
return docUrl;
} |
2988721_0 | public PackageBuilder() {
def = new PackageDefinitionImpl();
platforms = new ArrayList<>();
dependencies = new ArrayList<>();
conflicts = new ArrayList<>();
provides = new ArrayList<>();
entries = new LinkedHashMap<>();
installForms = new ArrayList<>();
validationForms = new ArrayList<>(... |
2988721_2 | @Override
public boolean equals(Object object) {
if (object == this) {
return true;
}
if (object instanceof Version) {
return isEqualTo((Version) object);
}
return false;
} |
2988721_6 | protected HashMap<String, String> evalDynamicProperties()
throws ConfigurationException {
HashMap<String, String> newParametersToSave = new HashMap<>();
evalLoopbackURL();
evalServerStatusKey(newParametersToSave);
return newParametersToSave;
} |
2988721_7 | public String setProperty(String key, String value)
throws ConfigurationException {
String oldValue = getStoredConfig().getProperty(key);
HashMap<String, String> newParametersToSave = new HashMap<>();
newParametersToSave.put(key, value);
saveFilteredConfiguration(newParametersToSave);
setBas... |
2988725_0 | @Override
public String sanitizeString(String string, String info) {
if (policy == null) {
log.error("Cannot sanitize, no policy registered");
return string;
}
try {
CleanResults cr = new AntiSamy().scan(string, policy);
for (Object err : cr.getErrorMessages()) {
... |
2988725_1 | @Override
public String sanitizeString(String string, String info) {
if (policy == null) {
log.error("Cannot sanitize, no policy registered");
return string;
}
try {
CleanResults cr = new AntiSamy().scan(string, policy);
for (Object err : cr.getErrorMessages()) {
... |
2988725_2 | protected static String guessEncoding(Blob blob) throws IOException {
// encoding already known?
if (blob.getEncoding() != null) {
return null;
}
// bad mime type?
String mimeType = blob.getMimeType();
if (mimeType == null) {
return null;
}
if (!mimeType.startsWith("text/... |
2988725_3 | @Override
public String getUrlFromDocumentView(DocumentView docView) {
// Use DocumentIdCodec if the document is a version
if ("true".equals(docView.getParameter("version"))) {
if (docView.getDocumentLocation().getIdRef() != null) {
DocumentIdCodec idCodec = new DocumentIdCodec();
... |
2988725_5 | @Override
public String getUrlFromDocumentView(DocumentView docView) {
// Use DocumentIdCodec if the document is a version
if ("true".equals(docView.getParameter("version"))) {
if (docView.getDocumentLocation().getIdRef() != null) {
DocumentIdCodec idCodec = new DocumentIdCodec();
... |
2988725_8 | public String getUrlFromDocumentView(DocumentView docView) {
DocumentLocation docLoc = docView.getDocumentLocation();
if (docLoc != null) {
List<String> items = new ArrayList<String>();
items.add(getPrefix());
items.add(docLoc.getServerName());
IdRef docRef = docLoc.getIdRef();
... |
2988725_9 | public DocumentView getDocumentViewFromUrl(String url) {
final Pattern pattern = Pattern.compile(getPrefix() + URLPattern);
Matcher m = pattern.matcher(url);
if (m.matches()) {
if (m.groupCount() >= 4) {
// for debug
// for (int i = 1; i < m.groupCount() + 1; i++) {
... |
2989006_0 | @OperationMethod
public DocumentModel run() {
if (StringUtils.isBlank(path)) {
return session.getRootDocument();
} else {
return session.getDocument(new PathRef(path));
}
} |
2989006_1 | @OperationMethod
public DocumentModel run() {
if (StringUtils.isBlank(path)) {
return session.getRootDocument();
} else {
return session.getDocument(new PathRef(path));
}
} |
2990192_0 | public static String encodeBytes(byte[] source) {
try {
return Base64.encodeBytes(source, Base64.URL_SAFE);
} catch (IOException e) {
throw new AssertionError(e);
}
} |
2990192_1 | public static String encodeBytesWithoutPadding(byte[] source) {
return encodeBytes(source).replace("=", "");
} |
2990192_2 | public static byte[] decode(String s) throws IOException {
return Base64.decode(s, Base64.URL_SAFE);
} |
2990192_3 | public static byte[] decodePaddingAgnostic(String s) throws IOException {
switch (s.length() % 4) {
case 1:
case 3: s = s + "="; break;
case 2: s = s + "=="; break;
}
return decode(s);
} |
2990192_4 | public static byte[] decodePaddingAgnostic(String s) throws IOException {
switch (s.length() % 4) {
case 1:
case 3: s = s + "="; break;
case 2: s = s + "=="; break;
}
return decode(s);
} |
2990192_5 | public void write(int b) throws IOException {
if (toSkip > 0) {
toSkip--;
} else {
out.write(b);
}
} |
2990192_6 | public void write(int b) throws IOException {
if (toSkip > 0) {
toSkip--;
} else {
out.write(b);
}
} |
2990192_7 | public void write(int b) throws IOException {
if (toSkip > 0) {
toSkip--;
} else {
out.write(b);
}
} |
2990192_8 | public void write(int b) throws IOException {
if (toSkip > 0) {
toSkip--;
} else {
out.write(b);
}
} |
2990192_9 | public void write(int b) throws IOException {
if (toSkip > 0) {
toSkip--;
} else {
out.write(b);
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.