id stringlengths 7 14 | text stringlengths 1 106k |
|---|---|
774658_0 | public String encode(String text) {
try {
Cipher cipher = createCipher(Cipher.ENCRYPT_MODE, MasterPasswordStore.getMasterPassword(), SALT);
byte[] encrypted = cipher.doFinal(text.getBytes("UTF-8"));
return DatatypeConverter.printBase64Binary(encrypted);
} catch (Exception e) {
th... |
774658_1 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
774658_2 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
774658_3 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
774658_4 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
774658_5 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
774658_6 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
774658_7 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
774658_8 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
774658_9 | public static Config<String, String> get(String name, boolean readSystemPropertiesOnNull) {
if (configurations.containsKey(name)) {
return configurations.get(name);
}
for (PropertiesProvider propertyProvider : propertyProviders) {
Map<String, String> props = propertyProvider.lookupProperties... |
782257_0 | public static String[] tokenize( final String aInput, final String aDelimiters )
{
if ( aInput == null )
{
return null;
}
final List<String> result = new ArrayList<String>();
final StringTokenizer tokenizer = new StringTokenizer( aInput, aDelimiters, false /* returnDelims */);
while ( tokenizer.hasMoreT... |
782257_1 | public static String[] tokenizeQuotedStrings( final String aInput, final String aDelimiters )
{
if ( aInput == null )
{
return null;
}
final List<String> result = new ArrayList<String>();
String lookback = "";
boolean inQuotedString = false;
final StringTokenizer tokenizer = new StringTokenizer( aInpu... |
782257_2 | public static String unquote( final String aInput )
{
return unquote( aInput, '"' );
} |
782257_3 | public static HtmlExporter createHtmlExporter()
{
return new HtmlExporterImpl( true /* aIncludeDTD */);
} |
782257_4 | public long getCount( final TYPE aValue )
{
if ( aValue == null )
{
throw new IllegalArgumentException( "Value cannot be null!" );
}
long result = 0L;
Long count = this.distribution.get( aValue );
if ( count != null )
{
result = count.longValue();
}
return result;
} |
782257_5 | public TYPE getHighestRanked()
{
TYPE result = null;
Long rank = null;
for ( final Map.Entry<TYPE, Long> entry : this.distribution.entrySet() )
{
if ( ( rank == null ) || ( rank.compareTo( entry.getValue() ) < 0 ) )
{
rank = entry.getValue();
result = entry.getKey();
}
}
return resul... |
782257_6 | public TYPE getLowestRanked()
{
TYPE result = null;
Long rank = null;
for ( final Map.Entry<TYPE, Long> entry : this.distribution.entrySet() )
{
if ( ( rank == null ) || ( rank.compareTo( entry.getValue() ) > 0 ) )
{
rank = entry.getValue();
result = entry.getKey();
}
}
return result... |
782257_7 | public static int convertByteOrder( final int aValue, final int aByteCount, final ByteOrder aByteOrder )
{
if ( ( aByteCount <= 0 ) || ( aByteCount > 32 ) )
{
throw new IllegalArgumentException( "Bit count cannot be zero, negative or beyond 32-bits!" );
}
final ByteBuffer buf = ByteBuffer.allocate( aByteCou... |
782257_8 | public static int getBitIndex( final int aMaskValue )
{
return ( int )Math.floor( Math.log( aMaskValue ) / Math.log( 2 ) );
} |
782257_9 | public static int getPercentage( final int aValue, final int aRange )
{
double value = 0.0;
if ( aRange != 0 )
{
value = aValue * 100.0 / aRange;
}
return ( int )Math.max( 0.0, Math.min( 100.0, value ) );
} |
790859_0 | @Override
public ExchangeDispatcher createDispatcher(final ServiceReference reference) {
if (_logger.isDebugEnabled()) {
_logger.debug("Creating Camel dispatcher for " + reference.getName());
}
String endpoint = "direct:" + reference.getName();
RouteBuilder rb = new CamelExchangeBusRouteBuilder(... |
790859_1 | @Override
public Dispatcher getDispatcher(ServiceReference reference) {
return _dispatchers.get(reference.getName());
} |
790859_2 | @Override
public Exchange createExchange(ExchangeHandler replyHandler, ExchangePattern pattern) {
DefaultExchange exchange = new DefaultExchange(_context, translate(pattern));
exchange.setIn(new CamelMessage(exchange));
return new CamelExchange(this, exchange, replyHandler);
} |
790859_3 | @Override
public Exchange createExchange(ExchangeHandler replyHandler, ExchangePattern pattern) {
DefaultExchange exchange = new DefaultExchange(_context, translate(pattern));
exchange.setIn(new CamelMessage(exchange));
return new CamelExchange(this, exchange, replyHandler);
} |
790859_4 | @Override
public Exchange createExchange(ExchangeHandler replyHandler, ExchangePattern pattern) {
DefaultExchange exchange = new DefaultExchange(_context, translate(pattern));
exchange.setIn(new CamelMessage(exchange));
return new CamelExchange(this, exchange, replyHandler);
} |
790859_5 | @Override
public Message transform(Message message) {
javax.xml.transform.Transformer transformer = null;
try {
DOMSource source = message.getContent(DOMSource.class);
DOMResult result = new DOMResult();
if (_transformerPool != null) {
transformer = _transformer... |
790859_6 | @Override
public Message transform(Message message) {
javax.xml.transform.Transformer transformer = null;
try {
DOMSource source = message.getContent(DOMSource.class);
DOMResult result = new DOMResult();
if (_transformerPool != null) {
transformer = _transformer... |
790859_7 | @Override
public Message transform(Message message) {
javax.xml.transform.Transformer transformer = null;
try {
DOMSource source = message.getContent(DOMSource.class);
DOMResult result = new DOMResult();
if (_transformerPool != null) {
transformer = _transformer... |
790859_8 | TransformerPool getTransformerPool() {
return _transformerPool;
} |
790859_9 | @Override
public Object transform(Object message) {
return _dozerBeanMapper.map(message, QNameUtil.toJavaMessageType(getTo()));
} |
806019_0 | @Override
public DateTime getEventDateTime()
{
return eventDateTime;
} |
806019_1 | @Override
public String getName()
{
return eventName;
} |
806019_2 | public Collection<String> getPathsForInterval(final ReadableInterval interval)
{
final Collection<String> paths = new ArrayList<String>();
granularity.stepThroughInterval(interval, new Granularity.Callback<RuntimeException>()
{
public void step(final ReadableInterval stepInterval) throws RuntimeExce... |
806019_3 | @Override
public Integer getInteger()
{
return value;
} |
806019_4 | @Override
public Integer getInteger()
{
return value;
} |
806019_5 | @Override
public Boolean getBoolean()
{
return !value.equals(0);
} |
806019_6 | @Override
public Byte getByte()
{
return value.byteValue();
} |
806019_7 | @Override
public Short getShort()
{
return value.shortValue();
} |
806019_8 | @Override
public Integer getInteger()
{
return value;
} |
806019_9 | @Override
public Long getLong()
{
return value.longValue();
} |
811072_0 | public String sayHelloEJB(String name) {
return "Hello " + name;
} |
812511_0 | public void encrypt(String password) throws GeneralSecurityException {
encrypt(password.getBytes());
} |
812511_1 | public void encrypt(String password) throws GeneralSecurityException {
encrypt(password.getBytes());
} |
812511_2 | public static String toGlobusID(String dn) {
return toGlobusID(dn, true);
} |
812511_3 | public static String toGlobusID(String dn) {
return toGlobusID(dn, true);
} |
812511_4 | public static String toGlobusID(String dn) {
return toGlobusID(dn, true);
} |
812511_5 | public static X500Principal toPrincipal(String globusID) {
if (globusID == null) {
return null;
}
String id = globusID.trim();
StringBuilder buf = new StringBuilder(id.length());
if (!id.isEmpty()) {
final int IDLE = 0;
final int VALUE = 1;
final int KEY = 2;
... |
812511_6 | public static X500Principal toPrincipal(String globusID) {
if (globusID == null) {
return null;
}
String id = globusID.trim();
StringBuilder buf = new StringBuilder(id.length());
if (!id.isEmpty()) {
final int IDLE = 0;
final int VALUE = 1;
final int KEY = 2;
... |
812511_7 | public static X500Principal toPrincipal(String globusID) {
if (globusID == null) {
return null;
}
String id = globusID.trim();
StringBuilder buf = new StringBuilder(id.length());
if (!id.isEmpty()) {
final int IDLE = 0;
final int VALUE = 1;
final int KEY = 2;
... |
812511_8 | public static X500Principal toPrincipal(String globusID) {
if (globusID == null) {
return null;
}
String id = globusID.trim();
StringBuilder buf = new StringBuilder(id.length());
if (!id.isEmpty()) {
final int IDLE = 0;
final int VALUE = 1;
final int KEY = 2;
... |
812511_9 | public static X500Principal toPrincipal(String globusID) {
if (globusID == null) {
return null;
}
String id = globusID.trim();
StringBuilder buf = new StringBuilder(id.length());
if (!id.isEmpty()) {
final int IDLE = 0;
final int VALUE = 1;
final int KEY = 2;
... |
816192_0 | public PluginManager() {
init();
} |
816192_1 | public Collection<Plugin> list() {
Collection<Plugin> list = new ArrayList<Plugin>();
BundleContext context = felix.getBundleContext();
Bundle[] bundles = context.getBundles();
for (Bundle b : bundles) {
ServiceReference[] refs = b.getRegisteredServices();
if (refs != null) {
... |
816192_2 | public void testPlugin(String name, String location, Map properties, boolean override) {
LogUtil.info(PluginManager.class.getName(), "====testPlugin====");
// check for existing plugin
Plugin plugin = getPlugin(name);
boolean existing = (plugin != null);
boolean install = (location != null && locati... |
816192_3 | public String getName() {
return "DepartmentVariablePlugin";
} |
816192_4 | public String getName() {
return "BeanShell Plugin";
} |
819907_0 | private void handleResourcePath(String rootPath, String resourcePath, BeanArchiveBuilder builder) {
WeldServletLogger.LOG.debugv("Handle resource path: {0}", resourcePath);
Set<String> subpaths = servletContext.getResourcePaths(resourcePath);
if (subpaths != null && !subpaths.isEmpty()) {
for (Strin... |
819907_1 | public static <B extends BeanDeploymentArchive> Multimap<String, BeanDeploymentArchive> findBeanClassesDeployedInMultipleBeanArchives(Set<B> beanArchives) {
if (beanArchives.size() == 1) {
return Multimaps.emptyMultimap();
}
SetMultimap<String, BeanDeploymentArchive> problems = SetMultimap.newSetMul... |
819907_2 | public static String extractBeanArchiveId(String beanArchiveRef, String base, String separator) {
beanArchiveRef = beanArchiveRef.replace('\\', '/');
StringBuilder id = new StringBuilder();
id.append(base);
id.append(BeanArchives.BEAN_ARCHIVE_ID_BASE_DELIMITER);
if (beanArchiveRef.contains(separator... |
819907_3 | public static boolean hasBeanDefiningMetaAnnotationSpecified(Annotation[] annotations, Class<? extends Annotation> metaAnnotationType) {
for (Annotation annotation : annotations) {
if (annotation.annotationType().isAnnotationPresent(metaAnnotationType)) {
return true;
}
}
return ... |
819907_4 | static String annotatedMethodToString(AnnotatedMethod<?> method, Class<?> beanClass) {
StringBuilder builder = new StringBuilder();
builder.append(Formats.addSpaceIfNeeded(Formats.formatAnnotations(method.getAnnotations())));
builder.append(Formats.formatModifiers(method.getJavaMember().getModifiers()));
... |
819907_5 | static String annotationToString(Annotation annotation) {
StringBuilder string = new StringBuilder();
string.append('@').append(annotation.annotationType().getName()).append('(');
String classAffix = ".class";
String quotationMark = "\"";
try {
List<Method> methods = Arrays.asList(annotation... |
819907_6 | static String abbreviate(String value, int limit) {
if (limit < ABR_MIN_LIMIT) {
throw new IllegalArgumentException("Minimum limit is 4");
}
if (value == null || value.length() <= limit) {
return value;
}
return value.substring(0, limit - ABR_MARKER.length()) + ABR_MARKER;
} |
819907_7 | static String[] getResourcePathParts(String requestUri, String contextPath) {
final String path = requestUri.substring(contextPath.length(), requestUri.length());
if (path.startsWith(REST_URL_PATTERN_BASE)) {
return Resource.splitPath(path.substring(REST_URL_PATTERN_BASE.length(), path.length()));
}... |
819907_8 | static Type parseType(String value, ResourceLoader resourceLoader) {
value = value.trim();
// Wildcards
if (value.equals(WILDCARD)) {
return WildcardTypeImpl.defaultInstance();
}
if (value.startsWith(WILDCARD_EXTENDS)) {
Type upperBound = parseType(value.substring(WILDCARD_EXTENDS.le... |
819907_9 | static List<QualifierInstance> parseQualifiers(String qualifiers, ResourceLoader resourceLoader, BeanManager beanManager) {
List<QualifierInstance> qualifierInstances = new ArrayList<>();
for (String qualifier : splitQualifiers(qualifiers)) {
qualifierInstances.add(createQualifierInstance(qualifier, res... |
828909_0 | @Override
public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> c,
HTableDescriptor desc, HRegionInfo[] regions) throws IOException {
requirePermission(Permission.Action.CREATE);
} |
828909_1 | @Override
public void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
HTableDescriptor htd) throws IOException {
requirePermission(tableName, null, null, Action.ADMIN, Action.CREATE);
} |
828909_2 | @Override
public void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
throws IOException {
requirePermission(tableName, null, null, Action.ADMIN, Action.CREATE);
} |
828909_3 | @Override
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
HColumnDescriptor column) throws IOException {
requirePermission(tableName, null, null, Action.ADMIN, Action.CREATE);
} |
828909_4 | @Override
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
HColumnDescriptor descriptor) throws IOException {
requirePermission(tableName, null, null, Action.ADMIN, Action.CREATE);
} |
828909_5 | @Override
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName,
byte[] col) throws IOException {
requirePermission(tableName, null, null, Action.ADMIN, Action.CREATE);
} |
828909_6 | @Override
public void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
throws IOException {
if (Bytes.equals(tableName, AccessControlLists.ACL_GLOBAL_NAME)) {
throw new AccessDeniedException("Not allowed to disable "
+ AccessControlLists.ACL_TABLE_NAME_STR + " table."... |
828909_7 | @Override
public void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> c, byte[] tableName)
throws IOException {
requirePermission(tableName, null, null, Action.ADMIN, Action.CREATE);
} |
828909_8 | @Override
public void preMove(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo region,
ServerName srcServer, ServerName destServer) throws IOException {
requirePermission(region.getTableName(), null, null, Action.ADMIN);
} |
828909_9 | @Override
public void preAssign(ObserverContext<MasterCoprocessorEnvironment> c, HRegionInfo regionInfo)
throws IOException {
requirePermission(regionInfo.getTableName(), null, null, Action.ADMIN);
} |
832025_0 | public POICategories getPOICategories() throws IOException {
Response<PoiTypesDto> response = v2Api.getPOICategories().execute();
return response.body().toPOICategories(context);
} |
832025_1 | public List<POI> getPOIs(final String type,
final double lonW,
final double latS,
final double lonE,
final double latN) throws IOException {
String bbox = toBboxString(lonW, latS, lonE, latN);
Response<FeatureCollect... |
832025_2 | public List<POI> getPOIs(final String type,
final double lonW,
final double latS,
final double lonE,
final double latN) throws IOException {
String bbox = toBboxString(lonW, latS, lonE, latN);
Response<FeatureCollect... |
832025_3 | public UserJourneys getUserJourneys(final String username) throws IOException {
Response<UserJourneysDto> response = v2Api.getUserJourneys(username).execute();
return response.body().toUserJourneys();
} |
832025_4 | public Photos getPhotos(final double lonW,
final double latS,
final double lonE,
final double latN) throws IOException {
String bbox = toBboxString(lonW, latS, lonE, latN);
Response<FeatureCollection> response = v2Api.getPhotos(bbox).execute();... |
832025_5 | public GeoPlaces geoCoder(final String search,
final double lonW,
final double latS,
final double lonE,
final double latN) throws IOException {
String bbox = toBboxString(lonW, latS, lonE, latN);
Response<Feature... |
832025_6 | public Result register(final String username,
final String password,
final String name,
final String email) throws IOException {
Response<UserCreateResponseDto> response = v2Api.register(username, password, name, email).execute();
return response.... |
832025_7 | public Result register(final String username,
final String password,
final String name,
final String email) throws IOException {
Response<UserCreateResponseDto> response = v2Api.register(username, password, name, email).execute();
return response.... |
832025_8 | public Signin.Result authenticate(final String identifier,
final String password) throws IOException {
Response<UserAuthenticateResponseDto> response = v2Api.authenticate(identifier, password).execute();
return response.body().toSigninResult();
} |
832025_9 | public Result sendFeedback(final int itinerary,
final String comments,
final String name,
final String email) throws IOException {
Response<SendFeedbackResponseDto> response = v2Api.sendFeedback("routing", itinerary, comments, name, emai... |
832676_0 | public static <T> Class<T> locate(Class<T> factoryId) {
return locate(factoryId, factoryId.getName());
} |
832676_1 | public static <T> Class<T> locate(Class<T> factoryId) {
return locate(factoryId, factoryId.getName());
} |
832676_2 | public static <T> Class<T> locate(Class<T> factoryId) {
return locate(factoryId, factoryId.getName());
} |
832676_3 | public static <T> Class<T> locate(Class<T> factoryId) {
return locate(factoryId, factoryId.getName());
} |
832676_4 | public void parse(Reader reader) throws IOException {
BufferedReader br = new BufferedReader(reader);
String line;
while ((line = br.readLine()) != null) {
if (!line.startsWith("#")) {
parse(line);
}
}
} |
832676_5 | public void parse(Reader reader) throws IOException {
BufferedReader br = new BufferedReader(reader);
String line;
while ((line = br.readLine()) != null) {
if (!line.startsWith("#")) {
parse(line);
}
}
} |
832676_6 | public static String getValueString(Object obj) {
if (obj == null) {
return "null";
} else if (obj instanceof boolean[]) {
return Arrays.toString((boolean[]) obj);
} else if (obj instanceof byte[]) {
return Arrays.toString((byte[]) obj);
} else if (obj instanceof char[]) {
... |
832676_7 | public static String getValueString(Object obj) {
if (obj == null) {
return "null";
} else if (obj instanceof boolean[]) {
return Arrays.toString((boolean[]) obj);
} else if (obj instanceof byte[]) {
return Arrays.toString((byte[]) obj);
} else if (obj instanceof char[]) {
... |
832676_8 | public static AnsiBufferedReader window(InputStream is, int begin, int end, int tabs) throws IOException {
AnsiBufferedReader reader = new AnsiBufferedReader(is, begin, end, Integer.MAX_VALUE);
reader.setTabs(tabs);
return reader;
} |
832676_9 | @Override
public boolean verifyServerKey(ClientSession sshClientSession, SocketAddress remoteAddress,
PublicKey serverKey) {
PublicKey knownKey;
try {
knownKey = knownHostsManager.getKnownKey(remoteAddress, serverKey.getAlgorithm());
} catch (InvalidKeySpecException e)... |
832679_0 | public String toString() {
StringBuilder resource = new StringBuilder();
for (String s : toStringList()) {
if (resource.length() > 0)
resource.append("\n");
resource.append(s);
}
return resource.toString();
} |
832679_1 | public String toString() {
StringBuilder resource = new StringBuilder();
for (String s : toStringList()) {
if (resource.length() > 0)
resource.append("\n");
resource.append(s);
}
return resource.toString();
} |
832679_2 | public String toString() {
StringBuilder resource = new StringBuilder();
for (String s : toStringList()) {
if (resource.length() > 0)
resource.append("\n");
resource.append(s);
}
return resource.toString();
} |
832679_3 | public String getHiera() {
String name = getName();
StringBuilder result = new StringBuilder();
for (Map.Entry<String, String> entry : attribs.entrySet()) {
result.append("\n" + name + "::" + entry.getKey() + ": " + entry.getValue());
}
return result.toString();
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.