id
stringlengths
7
14
text
stringlengths
1
106k
2752522_7
@Override public void close() { client.close(); }
2752522_8
@Override public void close() { client.close(); }
2752522_9
static String typeName(File schemaFile) { String typeName = schemaFile.getName(); return typeName.substring(0, typeName.length() - SUFFIX_json.length()); }
2755429_0
public CookieFromFile(File cookieFile, String type) throws IOException { this(); init(cookieFile, type); }
2755429_1
public String innerText() { return sbuf.toString(); }
2755429_2
public boolean isCookieFile(byte[] header) { if (COOKIE_FILE_HEADER.startsWith(new String(header))) { return true; } else { return false; } }
2755429_3
public String getValue(String domain, String name) throws IOException { final String QUERY = "SELECT value FROM moz_cookies WHERE host = \"" + domain + "\" AND name = \"" + name + "\""; ResultSet rs = null; String result = null; try { rs = statement.executeQuery(QUERY); if (rs.next()) { ...
2755429_4
public String toString() { StringBuilder s = new StringBuilder(""); for (Cmd c : map.values()) { s.append(" "); s.append(c.toString()); } return s.toString(); }
2755429_5
public String getNgWord() { return ngWord; }
2755429_6
public Type getType() { return type; }
2755429_7
public int getRegisterTime() { return registerTime; }
2755429_8
public boolean isUseCaseUnify() { return useCaseUnify; }
2755429_9
public boolean isRegex() { return regex; }
2784782_0
public static String sanitize(String name) { return sanitize(name, null); }
2784782_1
public <T extends Info> Iterable<Ref> list(Class<T> clazz) { List<Ref> list = null; EvictingQueue<Ref> q = q(clazz); synchronized (q) { list = new ArrayList(q); } Collections.reverse(list); return new LinkedHashSet<>(list); }
2784782_2
public static JSONObj proj(JSONObj obj, CoordinateReferenceSystem crs, String srs) { if (srs == null && crs != null) { try { srs = CRS.toSRS(crs); } catch (Exception e) { LOG.log(Level.WARNING, "Unable to determine srs from crs: " + crs, e); } } if (crs !...
2784782_3
public static JSONObj schema( JSONObj schema, FeatureType type, boolean details){ if( type != null ){ schema.put("name", type.getName().getLocalPart() ); schema.put("namespace", type.getName().getNamespaceURI() ); schema.put("simple", type instanceof SimpleFeatureType ); if (null != ...
2784782_4
@RequestMapping(value = "/list", method = RequestMethod.GET) public @ResponseBody JSONArr list(HttpServletRequest request) throws IOException { return list(null, request); }
2784782_5
@RequestMapping(value = "/{icon:.+}", method = RequestMethod.GET) public HttpEntity raw(@PathVariable String icon) throws IOException { return raw(null, icon); }
2784782_6
@RequestMapping(value = "/{srs}", method = RequestMethod.GET) public @ResponseBody JSONObj get(@PathVariable String srs) throws Exception { srs = srs.toUpperCase(); CoordinateReferenceSystem crs = null; try { crs = Proj.get().crs(srs); } catch(Exception e1) { throw new BadRequestExce...
2784782_7
@RequestMapping(value = "/recent", method = RequestMethod.GET) public @ResponseBody JSONArr recent() throws Exception { JSONArr arr = new JSONArr(); for (Map.Entry<String,CoordinateReferenceSystem> e : Proj.get().recent().entrySet()) { IO.proj(arr.addObject(), e.getValue(), e.getKey()); } return...
2784782_8
@RequestMapping(method = RequestMethod.GET) public @ResponseBody JSONArr list() { JSONArr arr = new JSONArr(); Catalog cat = geoServer.getCatalog(); WorkspaceInfo def = cat.getDefaultWorkspace(); if (def != null) { workspace(arr.addObject(), def, namespaceFor(def), true); } try ( ...
2784782_9
@RequestMapping(value = "/{wsName:.+}", method = RequestMethod.GET) public @ResponseBody JSONObj get(@PathVariable String wsName) { Catalog cat = geoServer.getCatalog(); WorkspaceInfo ws = findWorkspace(wsName, cat); WorkspaceInfo def = cat.getDefaultWorkspace(); JSONObj obj = IO.workspace(new JSONObj()...
2791813_0
@Override public City[] retrieveAll() { Ini iniFile; try { // Make sure the reader is closed, since Ini4J gives no guarantees. Reader reader = new BufferedReader(new FileReader(citiesFilePath)); iniFile = new Ini(reader); reader.close(); } catch (Exception e) { LOGGER.error("Cities loading failed!", e); ...
2791813_1
@Override public Account retrieve(String username) throws DAOException { Ini chara = readCharFile(username); if (null == chara) { return null; } // Add the single character's name. Set<String> characters = new HashSet<String>(); characters.add(username); return new AccountImpl( username, chara.get(INIT_H...
2791813_2
@Override public void delete(String name) { File charfile = new File(getCharFilePath(name)); if (!charfile.exists()) { return; } boolean success = charfile.delete(); if (!success) { LOGGER.error(String.format("Character (%s) deletion failed", name)); } }
2791813_3
@Override public NPCProperties[] retrieveAll() throws DAOException { Ini iniFile; try { // Make sure the reader is closed, since Ini4J gives no guarantees. Reader reader = new BufferedReader(new FileReader(npcsFilePath)); iniFile = new Ini(reader); reader.close(); } catch (Exception e) { logger.error("NPC ...
2791813_4
@Override public WorldMap[] retrieveAll() { final WorldMap[] maps = new WorldMap[mapsAmount]; // Maps enumeration starts at 1. for (int i = 1; i <= mapsAmount; i++) { maps[i - 1] = loadMap(i); } return maps; }
2791813_5
@Override public boolean handle(DataBuffer buffer, Connection connection) throws ArrayIndexOutOfBoundsException, UnsupportedEncodingException { // Check if there is enough data to attempt to read... if (buffer.getReadableBytes() < 12 + security.getPasswordHashLength() + security.getClientHashLength()) { return fa...
2791813_6
@Override public boolean handle(DataBuffer buffer, Connection connection) throws ArrayIndexOutOfBoundsException, UnsupportedEncodingException { // Check if there is enough data to attempt to read... if (buffer.getReadableBytes() < 12 + security.getPasswordHashLength() + security.getClientHashLength()) { return fa...
2791813_7
@Override public boolean handle(DataBuffer buffer, Connection connection) throws ArrayIndexOutOfBoundsException, UnsupportedEncodingException { // Check if there is enough data to attempt to read... if (buffer.getReadableBytes() < 12 + security.getPasswordHashLength() + security.getClientHashLength()) { return fa...
2791813_8
@Override public boolean handle(DataBuffer buffer, Connection connection) throws ArrayIndexOutOfBoundsException, UnsupportedEncodingException { // Check if there is enough data to attempt to read... if (buffer.getReadableBytes() < 12 + security.getPasswordHashLength() + security.getClientHashLength()) { return fa...
2791813_9
@Override public boolean handle(DataBuffer buffer, Connection connection) throws ArrayIndexOutOfBoundsException, UnsupportedEncodingException { // Check if there is enough data to attempt to read... if (buffer.getReadableBytes() < 12 + security.getPasswordHashLength() + security.getClientHashLength()) { return fa...
279216_10
public CreatePlaylist(Store store, String playlistName, boolean collaborative) { this.store = store; this.playlistName = playlistName; this.collaborative = collaborative; }
279216_11
@Override public Boolean send(DespotifyManager connectionManager) throws DespotifyException { byte[] data; /* Create channel callback */ ChannelCallback callback = new ChannelCallback(); /* Create channel and buffer. */ Channel channel = new Channel("Playlist-Channel", Channel.Type.TYPE_PLAYLIST, callback); ...
279216_12
@Override public Boolean send(DespotifyManager connectionManager) throws DespotifyException { // todo send multiple requests if more than 200 tracks! if (tracks.length > 240) { throw new DespotifyException("Can only load up to 240 track at the time."); } Create channel callback */ ChannelCallback callback ...
279216_13
public static boolean isHex(String value) { return hexPattern.matcher(value).matches(); }
279216_14
public static <T> T match(String URL, Visitor<T> matcher) { Matcher patternMatcher = pattern.matcher(URL); if (!patternMatcher.matches()) { throw new DespotifyException("Not a valid URL: " + URL); } URLtype urlType = patternMatcher.group(2) != null ? URLtype.httpURL : URLtype.spotifyURL; if (patternMatche...
279216_15
public static Visitable browse(String URL, final Store store, final Connection connection) { return match(URL, new Visitor<Visitable>(){ public Visitable track(URLtype type, String URI) { Track track = store.getTrack(SpotifyURI.toHex(URI)); try { new LoadTracks(store, track).send(connection); ...
279216_16
public static Visitable browse(String URL, final Store store, final Connection connection) { return match(URL, new Visitor<Visitable>(){ public Visitable track(URLtype type, String URI) { Track track = store.getTrack(SpotifyURI.toHex(URI)); try { new LoadTracks(store, track).send(connection); ...
279216_17
public static Visitable browse(String URL, final Store store, final Connection connection) { return match(URL, new Visitor<Visitable>(){ public Visitable track(URLtype type, String URI) { Track track = store.getTrack(SpotifyURI.toHex(URI)); try { new LoadTracks(store, track).send(connection); ...
279216_18
public static Visitable browse(String URL, final Store store, final Connection connection) { return match(URL, new Visitor<Visitable>(){ public Visitable track(URLtype type, String URI) { Track track = store.getTrack(SpotifyURI.toHex(URI)); try { new LoadTracks(store, track).send(connection); ...
279216_19
public Result send(Connection connection) throws DespotifyException { /* Create channel callback */ ChannelCallback callback = new ChannelCallback(); byte[] utf8Bytes = query.getBytes(Charset.forName("UTF8")); /* Create channel and buffer. */ Channel channel = new Channel("Search-Channel", Channel.Type.TYPE_S...
279216_20
@Override public Boolean send(Connection connection) throws DespotifyException { /* Create channel callback */ ChannelCallback callback = new ChannelCallback(); /* Send browse request. */ /* Create channel and buffer. */ Channel channel = new Channel("Browse-Channel", Channel.Type.TYPE_BROWSE, callback); By...
279216_21
@Override public Boolean send(Connection connection) throws DespotifyException { Create channel callback */ ChannelCallback callback = new ChannelCallback(); /* Send browse request. */ /* Create channel and buffer. */ Channel channel = new Channel("Browse-Channel", Channel.Type.TYPE_BROWSE, callback); ByteBu...
279216_22
@Override public Boolean send(Connection connection) throws DespotifyException { ChannelCallback callback = new ChannelCallback(); Channel channel = new Channel("Playlist-Channel", Channel.Type.TYPE_PLAYLIST, callback); ByteBuffer buffer = ByteBuffer.allocate(2 + 16 + 1 + 4 + 4 + 4 + 1); buffer.putShort((short...
279216_23
public CreatePlaylist(Store store, User user, String playlistName, boolean collaborative) { this.store = store; this.user = user; this.playlistName = playlistName; this.collaborative = collaborative; }
279216_24
@Override public Boolean send(Connection connection) throws DespotifyException { byte[] data; /* Create channel callback */ ChannelCallback callback = new ChannelCallback(); /* Create channel and buffer. */ Channel channel = new Channel("Playlist-Channel", Channel.Type.TYPE_PLAYLIST, callback); ByteBuffer b...
279216_25
@Override public Boolean send(Connection connection) throws DespotifyException { // todo send multiple requests if more than 200 tracks! if (tracks.length > 240) { throw new DespotifyException("Can only load up to 240 track at the time."); } Create channel callback */ ChannelCallback callback = new Channel...
279216_27
public static <T> T match(String URL, Visitor<T> matcher) { Matcher patternMatcher = pattern.matcher(URL); if (!patternMatcher.matches()) { throw new DespotifyException("Not a valid URL: " + URL); } URLtype urlType = patternMatcher.group(2) != null ? URLtype.httpURL : URLtype.spotifyURL; if (patternMatche...
279216_28
public static Visitable browse(String URL, final Store store, final ConnectionManager connectionManager) { return match(URL, new Visitor<Visitable>(){ public Visitable track(URLtype type, String URI) { Track track = store.getTrack(SpotifyURI.toHex(URI)); try { new LoadTracks(store, track).send...
279216_29
public static Visitable browse(String URL, final Store store, final ConnectionManager connectionManager) { return match(URL, new Visitor<Visitable>(){ public Visitable track(URLtype type, String URI) { Track track = store.getTrack(SpotifyURI.toHex(URI)); try { new LoadTracks(store, track).send...
279216_30
public static Visitable browse(String URL, final Store store, final ConnectionManager connectionManager) { return match(URL, new Visitor<Visitable>(){ public Visitable track(URLtype type, String URI) { Track track = store.getTrack(SpotifyURI.toHex(URI)); try { new LoadTracks(store, track).send...
279216_31
public static Visitable browse(String URL, final Store store, final ConnectionManager connectionManager) { return match(URL, new Visitor<Visitable>(){ public Visitable track(URLtype type, String URI) { Track track = store.getTrack(SpotifyURI.toHex(URI)); try { new LoadTracks(store, track).send...
279216_32
public Result send(ConnectionManager connectionManager) throws DespotifyException { /* Create channel callback */ ChannelCallback callback = new ChannelCallback(); byte[] utf8Bytes = query.getBytes(Charset.forName("UTF8")); /* Create channel and buffer. */ Channel channel = new Channel("Search-Channel", Chann...
279216_33
@Override public Artist send(ConnectionManager connectionManager) throws DespotifyException { Date now = new Date(); /* Create channel callback */ ChannelCallback callback = new ChannelCallback(); /* Send browse request. */ /* Create channel and buffer. */ Channel channel = new Channel("Browse-Channel", Cha...
279216_34
@Override public Album send(ConnectionManager connectionManager) throws DespotifyException { Create channel callback */ ChannelCallback callback = new ChannelCallback(); /* Send browse request. */ /* Create channel and buffer. */ Channel channel = new Channel("Browse-Channel", Channel.Type.TYPE_BROWSE, callbac...
279216_35
@Override public Boolean send(ConnectionManager connectionManager) throws DespotifyException { ChannelCallback callback = new ChannelCallback(); Channel channel = new Channel("Playlist-Channel", Channel.Type.TYPE_PLAYLIST, callback); ByteBuffer buffer = ByteBuffer.allocate(2 + 16 + 1 + 4 + 4 + 4 + 1); buffer.p...
279216_36
public CreatePlaylist(Store store, String playlistName, boolean collaborative) { this.store = store; this.playlistName = playlistName; this.collaborative = collaborative; }
279216_37
@Override public Boolean send(ConnectionManager connectionManager) throws DespotifyException { byte[] data; /* Create channel callback */ ChannelCallback callback = new ChannelCallback(); /* Create channel and buffer. */ Channel channel = new Channel("Playlist-Channel", Channel.Type.TYPE_PLAYLIST, callback); ...
279216_38
@Override public Boolean send(ConnectionManager connectionManager) throws DespotifyException { // todo send multiple requests if more than 200 tracks! if (tracks.length == 0) { throw new DespotifyException("No tracks supplied to be loaded!"); } if (tracks.length > 240) { throw new DespotifyException("Ca...
2797978_0
void uploadEvent(QueueEvent ev) throws IOException, ClientException { boolean retry = true; while (retry) { try { LOG.info(String.format("Uploading event logs to %s.%s on TreasureData (%d bytes, %d records)", ev.databaseName, ev.tableName, ev.data.length, ev.rowCount)); ...
2797978_1
public boolean emit(String tag, Map<String, Object> record) { if (record.containsKey("time")) { return emit0(tag, record); } else { return emit(tag, System.currentTimeMillis() / 1000, record); } }
2797978_2
synchronized ExtendedPacker write(Map<String, Object> v) throws IOException { packer.writeMapBegin(v.size()); { for (Map.Entry<String, Object> entry : v.entrySet()) { String key = entry.getKey(); if (!keys.contains(key)) { keys.add(key); if (keys.s...
2803695_0
@Override public boolean isSupported(OptionalFeature optionalFeature) { return false; }
2804383_0
public static synchronized IStorage openStorage(final File pFile) throws TTException { checkState(existsStorage(pFile), "DB could not be opened (since it was not created?) at location %s", pFile); StorageConfiguration config = StorageConfiguration.deserialize(pFile); final Storage storage = new Stor...
2804383_1
@Override public synchronized ISession getSession(final SessionConfiguration pSessionConf) throws TTException { final File resourceFile = new File(new File(mStorageConfig.mFile, StorageConfiguration.Paths.Data.getFile().getName()), pSessionConf.getResource()); Session returnVal = mSessions.g...
2804383_2
@Override public synchronized boolean close() throws TTException { for (final ISession session : mSessions.values()) { session.close(); } return STORAGEMAP.remove(mStorageConfig.mFile) != null; }
2804383_3
@Override public MetaBucket getMetaBucket() { checkState(!mDelegate.isClosed(), "Transaction already closed"); return mNewMeta; }
2804383_4
public IData getData(final long pDataKey) throws TTIOException { checkState(!mDelegate.isClosed(), "Transaction already closed"); // Calculate bucket and data part for given dataKey. final long dataBucketKey = pDataKey >> IConstants.INDIRECT_BUCKET_COUNT[3]; final int dataBucketOffset = dataBucketOffset...
2804383_5
public long setData(final IData pData) throws TTException { checkState(!mDelegate.isClosed(), "Transaction already closed"); // Allocate data key and increment data count. final long dataKey = pData.getDataKey(); final long seqBucketKey = dataKey >> IConstants.INDIRECT_BUCKET_COUNT[3]; final int dat...
2804383_6
@Override public void removeData(final IData pData) throws TTException { checkState(!mDelegate.isClosed(), "Transaction already closed"); checkNotNull(pData); final long dataBucketKey = pData.getDataKey() >> IConstants.INDIRECT_BUCKET_COUNT[3]; LogValue container = prepareDataBucket(pData.getDataKey());...
2804383_7
public static StorageConfiguration deserialize(final File pFile) throws TTIOException { try { FileReader fileReader = new FileReader(new File(pFile, Paths.ConfigBinary.getFile().getName())); JsonReader jsonReader = new JsonReader(fileReader); jsonReader.beginObject(); jsonReader.next...
2804383_8
public static ResourceConfiguration deserialize(final File pFile, final String pResource) throws TTIOException { try { final File file = new File(new File(new File(pFile, StorageConfiguration.Paths.Data.getFile().getName()), pResource), Paths.ConfigBinary.getFile().getName())...
2804383_9
public IBucketReadTrx beginBucketRtx(final long pRevKey) throws TTException { waitForRunningCommit(); assertAccess(pRevKey); final IBackendReader bucketReader = mResourceConfig.mBackend.getReader(); final RevisionRootBucket revBucket = (RevisionRootBucket)bucketReader .read(BucketRea...
2818491_0
@Override public InputStream next() throws IOException { while (true) { if (zipIterator == null) { final File file = fileIterator.next(); // not all specified Files exists! if (file == null || !file.isFile()) { return null; } else { ...
2818491_1
public void detect() throws IOException { detect(new ClassFileIterator()); }
2818491_2
public void detect() throws IOException { detect(new ClassFileIterator()); }
2818491_3
public void detect() throws IOException { detect(new ClassFileIterator()); }
2818491_4
public void detect() throws IOException { detect(new ClassFileIterator()); }
283187_10
final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); }
283187_11
final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); }
283187_12
final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); }
283187_13
final public static FormattingTuple format(String messagePattern, Object arg) { return arrayFormat(messagePattern, new Object[] { arg }); }
283187_14
final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } ...
283187_15
final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } ...
283187_16
final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } ...
283187_17
final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } ...
283187_18
final public static FormattingTuple arrayFormat(final String messagePattern, final Object[] argArray) { Throwable throwableCandidate = MessageFormatter.getThrowableCandidate(argArray); Object[] args = argArray; if (throwableCandidate != null) { args = MessageFormatter.trimmedCopy(argArray); } ...
283187_19
public static void install() { LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler()); }
283187_20
public static void install() { LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler()); }
283187_21
public static void install() { LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler()); }
283187_22
public static void install() { LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler()); }
283187_23
public static void install() { LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler()); }
283187_24
public static void install() { LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler()); }
283187_25
public static void install() { LogManager.getLogManager().getLogger("").addHandler(new SLF4JBridgeHandler()); }
283187_26
public void convertProject(File folder) { FileSelector fs = new FileSelector(progressListener); List<File> fileList = fs.selectJavaFilesInFolder(folder); scanFileList(fileList); progressListener.onDone(); }
283187_27
public String abbreviate(String filename) { if (filename.length() <= desiredLength) { return filename; } else { int firstIndex = filename.indexOf(folderSeparator, invariantPrefixLength); if (firstIndex == -1) { // we cant't process this string return filename; ...
283187_28
public String abbreviate(String filename) { if (filename.length() <= desiredLength) { return filename; } else { int firstIndex = filename.indexOf(folderSeparator, invariantPrefixLength); if (firstIndex == -1) { // we cant't process this string return filename; ...
283187_29
public String abbreviate(String filename) { if (filename.length() <= desiredLength) { return filename; } else { int firstIndex = filename.indexOf(folderSeparator, invariantPrefixLength); if (firstIndex == -1) { // we cant't process this string return filename; ...