/*
Create a {@link PushSubscription} instance containing only an id

@param str the ID obtained from DataSift for creating a push subscription
@return an instance which can be used by the client
324429
public static PushSubscription fromString(String str) {
        if (str == null || str.isEmpty()) {
            throw new IllegalArgumentException("Cannot create a stream from an empty or null string");
        }
        PushSubscription stream = new PushSubscription();
        stream.id = str;
        return stream;
    }
1347965
public IStringBuffer append( String str )
    {
        if ( str == null )
            throw new NullPointerException();
        //check the necessary to resize the buffer.
        if ( count + str.length() > buff.length ) {
            resizeTo( (count + str.length()) * 2 + 1 );
        }
        
        for ( int j = 0; j < str.length(); j++ ) {
            buff[count++] = str.charAt(j);
        }
        
        return this;
    }
148720
public FutureData<PushSubscription> update(String id, PushConnector connector, String name) {
        if (id == null || id.isEmpty() || connector == null) {
            throw new IllegalArgumentException("A push subscription ID and output parameters is required");
        }
        FutureData<PushSubscription> future = new FutureData<>();
        URI uri = newParams().forURL(config.newAPIEndpointURI(UPDATE));
        POST request = config.http()
                .POST(uri, new PageReader(newRequestCallback(future, new PushSubscription(), config)))
                .form("id", id);
        for (Map.Entry<String, String> e : connector.parameters().verifyAndGet().entrySet()) {
            request.form(e.getKey(), e.getValue());
        }
        if (name != null && !name.isEmpty()) {
            request.form("name", name);
        }
        performRequest(future, request);
        return future;
    }
21219
private String intern(final String str) {
        if (str == null) {
            return null;
        }
        final String interned = stringInternMap.putIfAbsent(str, str);
        if (interned != null) {
            return interned;
        }
        return str;
    }
643819
public static Stream fromString(String str) {
        if (str == null || str.isEmpty()) {
            throw new IllegalArgumentException("Cannot create a stream from an empty or null string");
        }
        Stream stream = new Stream();
        stream.hash = str;
        return stream;
    }
1123739
@Override
  public Identifier getNewInstance(final String str) {

    final int index = str.indexOf("://");
    if (index < 0) {
      throw new RemoteRuntimeException("Invalid remote identifier name: " + str);
    }

    final String type = str.substring(0, index);
    final Class<? extends Identifier> clazz = typeToClazzMap.get(type);

    try {

      final Constructor<? extends Identifier> constructor = clazz.getDeclaredConstructor(CONSTRUCTOR_ARG_TYPES);
      final Object[] args = new Object[] {str.substring(index + 3)};

      final Identifier instance = constructor.newInstance(args);
      LOG.log(Level.FINER, "Created new identifier: {0} for {1}", new Object[] {instance, str});
      return instance;

    } catch (final NoSuchMethodException | SecurityException | InstantiationException
        | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      LOG.log(Level.SEVERE, "Cannot create new identifier for: " + str, e);
      throw new RemoteRuntimeException(e);
    }
  }
204884
@Override
	public boolean add(String str) {
		boolean flag = true;
		for (BloomFilter filter : filters) {
			flag |= filter.add(str);
		}
		return flag;
	}
1178013
public static PrivateKey stringToRSAPrivateKey (String str)
    {
        try {
            BigInteger mod = new BigInteger(str.substring(0, str.indexOf(SPLIT)), 16);
            BigInteger exp = new BigInteger(str.substring(str.indexOf(SPLIT) + 1), 16);
            RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(mod, exp);
            KeyFactory kf = KeyFactory.getInstance("RSA");
            return kf.generatePrivate(keySpec);
        } catch (NumberFormatException nfe) {
            log.warning("Failed to read key from string.", "str", str, nfe);
        } catch (GeneralSecurityException gse) {
            log.warning("Failed to read key from string.", "str", str, gse);
        }
        return null;
    }
786391
public static JsonReader createFromStringNNT(String str) {
		try {
			JsonFactory factory = new JsonFactory();
			JsonParser jsonParser = factory.createParser(str);
	
			return new JsonParserReader(jsonParser);
		}
		catch (Exception ex) {
			throw new JsonGeometryException(ex.getMessage());
		}
	}
1046411
public StringGrabber insertIntoHead(String str) {

		if (str != null) {
			try {
				sb.insert(0, str);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

		return StringGrabber.this;
	}
647197
public SubscriptionEnvelope getSubscription(String subId) throws ApiException {
        ApiResponse<SubscriptionEnvelope> resp = getSubscriptionWithHttpInfo(subId);
        return resp.getData();
    }
914981
@Override
	public <P extends ParaObject> String create(String appid, P so) {
		if (so == null) {
			return null;
		}
		if (StringUtils.isBlank(so.getId())) {
			so.setId(Utils.getNewId());
		}
		if (so.getTimestamp() == null) {
			so.setTimestamp(Utils.timestamp());
		}
		so.setAppid(appid);
		createRow(so.getId(), appid, toRow(so, null));
		logger.debug("DAO.create() {}->{}", appid, so.getId());
		return so.getId();
	}
967310
public StrBuilder append(final String str) {
        if (str == null) {
            return appendNull();
        }
        final int strLen = str.length();
        if (strLen > 0) {
            final int len = length();
            ensureCapacity(len + strLen);
            str.getChars(0, strLen, buffer, len);
            size += strLen;
        }
        return this;
    }
485321
private static Shard createShardFromString(String str) {
    int first = str.indexOf("@");
    int second = str.indexOf("@", first + 1);
    long version = Long.parseLong(str.substring(0, first));
    String dir = str.substring(first + 1, second);
    long gen = Long.parseLong(str.substring(second + 1));
    return new Shard(version, dir, gen);
  }
487123
public static String encrypt(String str) {
	if (StringUtil.isEmpty(str)) return "";
	if (StringUtil.startsWithIgnoreCase(str, "encrypted:")) return str;
	return "encrypted:" + new BlowfishEasy("sdfsdfs").encryptString(str);
    }
587465
@Override
	public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) throws JMSException
    {
    	externalAccessLock.readLock().lock();
    	try
		{
	        checkNotClosed();
	        
	        RemoteTopicSubscriber subscriber =  new RemoteTopicSubscriber(idProvider.createID(),
	        		                                                      this,
	                                                                      DestinationTools.asRef(topic),
	                                                                      messageSelector,
	                                                                      noLocal);
	        registerConsumer(subscriber);
	        subscriber.remoteInit();
	        return subscriber;
		}
    	finally
    	{
    		externalAccessLock.readLock().unlock();
    	}
    }
254982
@Nonnull
    public static IRI create(@Nonnull String str) {
        checkNotNull(str, "str cannot be null");
        int index = XMLUtils.getNCNameSuffixIndex(str);
        if (index < 0) {
            // no ncname
            return new IRI(str, "");
        }
        return new IRI(str.substring(0, index), str.substring(index));
    }