text string | label int64 |
|---|---|
[CLS] public static void notify(String msg) throws Exception {
String url = "http://api.clickatell.com/http/sendmsg?";
url = add(url, "user", user);
url = add(url, "password", password);
url = add(url, "api_id", apiId);
url = add(url, "to", to);
url = add(url, "text", msg... | 0 |
[CLS] private Object[] retrieveSecondURL(URL url, RSLink link) {
link.setStatus(RSLink.STATUS_WAITING);
Object[] result = new Object[2];
HttpURLConnection httpConn = null;
BufferedReader inr = null;
DataOutputStream outs = null;
Pattern mirrorLinePattern = Pattern.compile... | 1 |
[CLS] private static boolean computeCustomerAverages(String completePath, String CustomerAveragesOutputFileName, String CustIndexFileName) {
try {
File inputFile = new File(completePath + fSep + "SmartGRAPE" + fSep + CustIndexFileName);
FileChannel inC = new FileInputStream(inputFile).ge... | 0 |
[CLS] public void sortIndexes() {
int i, j, count;
int t;
count = m_ItemIndexes.length;
for (i = 1; i < count; i++) {
for (j = 0; j < count - i; j++) {
if (m_ItemIndexes[j] > m_ItemIndexes[j + 1]) {
t = m_ItemIndexes[j];
... | 0 |
[CLS] private static boolean copyFile(File src, File dest) {
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(src);
fos = new FileOutputStream(dest);
for (int c = fis.read(); c != -1; c = fis.read()) fos.write(c);
... | 0 |
[CLS] public static String upload(File tmpFile, URL url) throws IOException {
StringBuffer reply = new StringBuffer();
URLConnection uc = url.openConnection();
ClientHttpRequest request = new ClientHttpRequest(uc);
String file = "file";
String filename = tmpFile.getName();
... | 0 |
[CLS] @Override
public void close() throws IOException {
super.close();
byte[] signatureData = toByteArray();
ZipOutputStream zipOutputStream = new ZipOutputStream(this.targetOutputStream);
ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(this.originalZipFile));... | 1 |
[CLS] private static String md5(String text) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(text.getBytes("UTF-8"));
byte[] messageDigest = digest.digest();
StringBuilder hexString = new StringBuilder();
for (int i = 0; ... | 0 |
[CLS] public void run() {
try {
IOUtils.copy(is, os);
os.flush();
} catch (IOException ioe) {
logger.error("Unable to copy", ioe);
} finally {
IOUtils.closeQuietly(is);
IOUtils.closeQuietly(os);
... | 1 |
[CLS] public void create(Session session) {
Connection conn = session.getConnection(this);
Statement stat = null;
StringBuilder out = new StringBuilder(256);
Appendable sql = out;
List<MetaTable> tables = new ArrayList<MetaTable>();
List<MetaColumn> newColumns = new Array... | 1 |
[CLS] private static void readAndRewrite(File inFile, File outFile) throws IOException {
ImageInputStream iis = ImageIO.createImageInputStream(new BufferedInputStream(new FileInputStream(inFile)));
DcmParser dcmParser = DcmParserFactory.getInstance().newDcmParser(iis);
Dataset ds = DcmObjectFact... | 0 |
[CLS] private void sortWhats(String[] labels, int[] whats, String simplifyString) {
int n = whats.length;
boolean swapped;
do {
swapped = false;
for (int i = 0; i < n - 1; i++) {
int i0_pos = simplifyString.indexOf(labels[whats[i]]);
int i1... | 0 |
[CLS] public void unzip(String resource) {
File f = new File(resource);
if (!f.exists()) throw new RuntimeException("The specified resources does not exist (" + resource + ")");
String parent = f.getParent().toString();
try {
BufferedOutputStream dest = null;
File... | 0 |
[CLS] public static void main(String[] args) throws Exception {
DES des = new DES();
StreamBlockReader reader = new StreamBlockReader(new FileInputStream("D:\\test.txt"));
StreamBlockWriter writer = new StreamBlockWriter(new FileOutputStream("D:\\test1.txt"));
SingleKey key = new SingleK... | 1 |
[CLS] public static void main(String[] args) throws IOException {
File inputFile = new File("D:/farrago.txt");
File outputFile = new File("D:/outagain.txt");
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read... | 1 |
[CLS] public static String encripty(String toEncripty) {
if (toEncripty != null) {
try {
synchronized (toEncripty) {
java.security.MessageDigest md = java.security.MessageDigest.getInstance("MD5");
md.update(toEncripty.getBytes());
... | 1 |
[CLS] public static String getMD5(String value) {
if (StringUtils.isBlank(value)) return null;
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(value.getBytes("UTF-8"));
return toHexString(md.digest());
} catch (Throwable e) {
r... | 0 |
[CLS] public static void convertEncoding(File infile, File outfile, String from, String to) throws IOException, UnsupportedEncodingException {
InputStream in;
if (infile != null) in = new FileInputStream(infile); else in = System.in;
OutputStream out;
outfile.createNewFile();
if ... | 1 |
[CLS] @Override
protected IStatus runCancelableRunnable(IProgressMonitor monitor) {
IStatus returnValue = Status.OK_STATUS;
monitor.beginTask(NLS.bind(Messages.SaveFileOnDiskHandler_SavingFiles, open), informationUnitsFromExecutionEvent.size());
... | 1 |
[CLS] public static boolean insert(final Funcionario objFuncionario) {
int result = 0;
final Connection c = DBConnection.getConnection();
PreparedStatement pst = null;
if (c == null) {
return false;
}
try {
c.setAutoCommit(false);
final... | 0 |
[CLS] public void applyTo(File source, File target) throws IOException {
boolean failed = true;
FileInputStream fin = new FileInputStream(source);
try {
FileChannel in = fin.getChannel();
FileOutputStream fos = new FileOutputStream(target);
... | 1 |
[CLS] public void copyFile2(String src, String dest) throws IOException {
String newLine = System.getProperty("line.separator");
FileWriter fw = null;
FileReader fr = null;
BufferedReader br = null;
BufferedWriter bw = null;
File source = null;
try {
f... | 0 |
[CLS] protected static final void copyFile(String from, String to) throws SeleniumException {
try {
java.io.File fileFrom = new File(from);
java.io.File fileTo = new File(to);
FileReader in = new FileReader(fileFrom);
FileWriter out = new FileWriter(fileTo);
... | 1 |
[CLS] boolean copyFileStructure(File oldFile, File newFile) {
if (oldFile == null || newFile == null) return false;
File searchFile = newFile;
do {
if (oldFile.equals(searchFile)) return false;
searchFile = searchFile.getParentFile();
} while (searchFile != null);... | 1 |
[CLS] public static void unzip2(File zipfile, File outputdir) throws IOException {
//Buffer for extracting files
byte[] buffer = new byte[1024];
//Zip file
ZipFile zip = new ZipFile(zipfile);
//Get entries
Enumeration<ZipArchiveEntry> files = zip.getEntries();
//Iterate through the entries
... | 0 |
[CLS] private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
URL url = new URL(upgradeURL);
InputStream in = url.openStream();
BufferedInputStream buffIn = new BufferedInputStream(in);
FileOutputStream out = new FileOutputStream("");
... | 0 |
[CLS] public void copyFile(File s, File t) {
try {
FileChannel in = (new FileInputStream(s)).getChannel();
FileChannel out = (new FileOutputStream(t)).getChannel();
in.transferTo(0, s.length(), out);
in.close();
out.close();
} catch (Exception ... | 1 |
[CLS] private static void zipFolder(File folder, ZipOutputStream zipOutputStream, String relativePath) throws IOException {
File[] children = folder.listFiles();
for (int i = 0; i < children.length; i++) {
File child = children[i];
if (child.isFile()) {
String zip... | 1 |
[CLS] private static void copy(String from_name, String to_name) throws IOException {
File from_file = new File(from_name);
File to_file = new File(to_name);
if (!from_file.exists()) abort("�������� ���� �� ���������" + from_file);
if (!from_file.isFile()) abort("���������� ����������� �... | 0 |
[CLS] public static String URLtoString(URL url) throws IOException {
String xml = null;
if (url != null) {
URLConnection con = url.openConnection();
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
con.setRequestProperty("User-agent", "Mozi... | 0 |
[CLS] private String determineGuardedHtml() {
StringBuffer buf = new StringBuffer();
if (m_guardedButtonPresent) {
buf.append("\n<span id='" + getHtmlIdPrefix() + PUSH_PAGE_SUFFIX + "' style='display:none'>\n");
String location = m_guardedHtmlLocation != null ? m_guardedHtmlLocat... | 0 |
[CLS] public static String encrypt(String password, String algorithm, byte[] salt) {
StringBuffer buffer = new StringBuffer();
MessageDigest digest = null;
int size = 0;
if ("CRYPT".equalsIgnoreCase(algorithm)) {
throw new InternalError("Not implemented");
} else if (... | 1 |
[CLS] @org.junit.Test
public void simpleRead() throws Exception {
final InputStream istream = StatsInputStreamTest.class.getResourceAsStream("/testFile.txt");
final StatsInputStream ris = new StatsInputStream(istream);
assertEquals("read size", 0, ris.getSize());
IOUtils.copy(ris, ne... | 1 |
[CLS] public static void openFile(PublicHubList hublist, String url) {
BufferedReader fichAl;
String linha;
try {
if (url.startsWith("http://")) fichAl = new BufferedReader(new InputStreamReader((new java.net.URL(url)).openStream())); else fichAl = new BufferedReader(new FileReader(u... | 0 |
[CLS] public void copy(String pathFileIn, String pathFileOut) {
try {
File inputFile = new File(pathFileIn);
File outputFile = new File(pathFileOut);
FileReader in = new FileReader(inputFile);
File outDir = new File(DirOut);
if (!outDir.exists()) outDi... | 1 |
[CLS] private String fetchContent() throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
StringBuffer buf = new StringBuffer();
String str;
while ((str = reader.readLine()) != null) {
buf.append(str);
}
retu... | 0 |
[CLS] public static String convertToSha1(final String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[40];
md.update(text.getBytes("iso-8859-1"), 0, text.length());
sha1has... | 1 |
[CLS] @Override
public boolean copyFile(String srcRootPath, String srcDir, String srcFileName, String destRootPath, String destDir, String destFileName) {
File srcPath = new File(srcRootPath + separator() + Database.getDomainName() + separator() + srcDir);
if (!srcPath.exists()) {
try {
... | 1 |
[CLS] public static String rename_file(String sessionid, String key, String newFileName) {
String jsonstring = "";
try {
Log.d("current running function name:", "rename_file");
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("https://... | 0 |
[CLS] public void unzip(String resource) {
File f = new File(resource);
if (!f.exists()) throw new RuntimeException("The specified resources does not exist (" + resource + ")");
String parent = f.getParent().toString();
try {
BufferedOutputStream dest = null;
File... | 1 |
[CLS] public static AddUserResponse napiUserAdd(String user, String pass, String email) throws TimeoutException, InterruptedException, IOException {
if (user.matches("^[a-zA-Z0-9]{2,20}$") == false) {
return AddUserResponse.NAPI_ADD_USER_BAD_LOGIN;
}
if (pass.equals("")) {
... | 0 |
[CLS] private void doDecrypt(boolean createOutput) throws IOException {
FileInputStream input = null;
FileOutputStream output = null;
File tempOutput = null;
try {
input = new FileInputStream(infile);
String cipherBaseFilename = basename(infile);
byte[... | 1 |
[CLS] private static byte[] Md5f(String plainText) {
byte[] ab = new byte[16];
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(plainText.getBytes());
byte b[] = md.digest();
ab = b;
} catch (NoSuchAlgorithmException e) {
... | 1 |
[CLS] private void resourceDirectoryCopy(String resource, IProject project, String target, IProgressMonitor monitor) throws URISyntaxException, IOException, CoreException {
if (!target.endsWith("/")) {
target += "/";
}
String res = resource;
if (!res.endsWith("/")) ;
... | 0 |
[CLS] private static void copySmallFile(File sourceFile, File targetFile) throws BusinessException {
LOG.debug("Copying SMALL file '" + sourceFile.getAbsolutePath() + "' to '" + targetFile.getAbsolutePath() + "'.");
FileChannel inChannel = null;
FileChannel outChannel = null;
try {
... | 1 |
[CLS] private String fetch(String urlstring) {
String content = "";
try {
URL url = new URL(urlstring);
InputStream is = url.openStream();
BufferedReader d = new BufferedReader(new InputStreamReader(is));
String s;
while (null != (s = d.readLin... | 0 |
[CLS] public void setNewPassword(String password) {
try {
final MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(password.getBytes());
final String encrypted = "{MD5}" + new String(Base64Encoder.encode(digest.digest()));
setUserPassword(encry... | 1 |
[CLS] private InputStream getDomainMap() {
String domainMap = Configuration.getString(MAPPING_KEY);
InputStream is = new StringBufferInputStream(domainMap);
if ("".equals(domainMap)) {
try {
URL url = getClass().getResource(XML_FILE_NAME).toURI().toURL();
... | 0 |
[CLS] public static String MD5(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[32];
md.update(text.getBytes("iso-8859-1"), 0, text.length());
md5hash = md.digest();
... | 0 |
[CLS] public String stringOfUrl(String addr) throws IOException {
ByteArrayOutputStream output = new ByteArrayOutputStream();
URL url = new URL(addr);
IOUtils.copy(url.openStream(), output);
return output.toString();
} [SEP] public File convert(URI uri) throws DjatokaException {
... | 1 |
[CLS] public void applyTo(File source, File target) throws IOException {
boolean failed = true;
FileInputStream fin = new FileInputStream(source);
try {
FileChannel in = fin.getChannel();
FileOutputStream fos = new FileOutputStream(target);
... | 1 |
[CLS] @Override
protected String doInBackground(String... params) {
HttpURLConnection conn = null;
String localFilePath = params[0];
if (localFilePath == null) {
return null;
}
try {
URL url = new URL(ConnectionHandler.getServerURL() + ":" + Connection... | 0 |
[CLS] public void testConvert() throws IOException, ConverterException {
InputStreamReader reader = new InputStreamReader(new FileInputStream("test" + File.separator + "input" + File.separator + "A0851ohneex.dat"), CharsetUtil.forName("x-PICA"));
FileWriter writer = new FileWriter("test" + File.separato... | 1 |
[CLS] public static void connectServer() {
if (ftpClient == null) {
int reply;
try {
setArg(configFile);
ftpClient = new FTPClient();
ftpClient.setDefaultPort(port);
ftpClient.configure(getFtpConfig());
ftpCl... | 0 |
[CLS] public String getData() throws ValueFormatException, RepositoryException, IOException {
InputStream is = getStream();
StringWriter sw = new StringWriter();
IOUtils.copy(is, sw, "UTF-8");
IOUtils.closeQuietly(is);
return sw.toString();
} [SEP] public static String getDoc... | 0 |
[CLS] public static void main(String[] args) throws IOException {
long readfilelen = 0;
BufferedRandomAccessFile brafReadFile, brafWriteFile;
brafReadFile = new BufferedRandomAccessFile("C:\\WINNT\\Fonts\\STKAITI.TTF");
readfilelen = brafReadFile.initfilelen;
brafWriteFile = new ... | 0 |
[CLS] public static JSONObject delete(String uid) throws ClientProtocolException, IOException, JSONException {
HttpClient client = new DefaultHttpClient(params);
HttpGet get = new HttpGet(DELETE_URI + "?uid=" + uid);
HttpResponse response = client.execute(get);
if (response.getStatusLine... | 0 |
[CLS] private static List<CountryEntry> retrieveCountries() throws IOException {
URL url = new URL("http://" + ISO_3166_HOST + ISO_3166_TXT_FILE_PATH);
BufferedReader input = new BufferedReader(new InputStreamReader(url.openStream()));
List<CountryEntry> countries = new LinkedList<CountryEntry>(... | 0 |
[CLS] public static void main(String[] args) throws Exception {
URL url = new URL("http://www.sohu.com");
InputStream is = url.openStream();
InputStreamReader isr = new InputStreamReader(is, Charset.forName("GB18030"));
FileOutputStream fos = new FileOutputStream("gen/sohu2.html");
... | 0 |
[CLS] public void convert(File src, File dest) throws IOException {
InputStream in = new BufferedInputStream(new FileInputStream(src));
DcmParser p = pfact.newDcmParser(in);
Dataset ds = fact.newDataset();
p.setDcmHandler(ds.getDcmHandler());
try {
FileFormat format =... | 1 |
[CLS] public static String getURL(String urlString, String getData, String postData) {
try {
if (getData != null) if (!getData.equals("")) urlString += "?" + getData;
URL url = new URL(urlString);
URLConnection connection = url.openConnection();
if (!postData.equa... | 1 |
[CLS] private void reloadData(String dataSourceUrl) {
try {
URL url = new URL(dataSourceUrl);
InputStream is = url.openStream();
if (progressMonitor.isCanceled() == false) {
progressMonitor.setNote("Building classifications...");
progressMonito... | 0 |
[CLS] public boolean actualizarIdPartida(int idJugadorDiv, int idRonda, int idPartida) {
int intResult = 0;
String sql = "UPDATE jugadorxdivxronda " + " SET idPartida = " + idPartida + " WHERE jugadorxDivision_idJugadorxDivision = " + idJugadorDiv + " AND ronda_numeroRonda = " + idRonda;
try {
... | 1 |
[CLS] public void convert(File src, File dest) throws IOException {
InputStream in = new BufferedInputStream(new FileInputStream(src));
DcmParser p = pfact.newDcmParser(in);
Dataset ds = fact.newDataset();
p.setDcmHandler(ds.getDcmHandler());
try {
FileFormat format =... | 1 |
[CLS] @Test
public void testSQLite() {
log("trying SQLite..");
for (int i = 0; i < 10; i++) {
Connection c = null;
try {
Class.forName("SQLite.JDBCDriver");
c = DriverManager.getConnection("jdbc:sqlite:/C:/Source/SRFSurvey/app/src/org/speakrigh... | 0 |
[CLS] public static File insertFileInto(File zipFile, File toInsert, String targetPath) {
Zip64File zip64File = null;
try {
boolean compress = false;
zip64File = new Zip64File(zipFile);
FileEntry testEntry = getFileEntry(zip64File, targetPath);
if (testEnt... | 1 |
[CLS] @Test
public void testRegisterOwnJceProvider() throws Exception {
MyTestProvider provider = new MyTestProvider();
assertTrue(-1 != Security.addProvider(provider));
MessageDigest messageDigest = MessageDigest.getInstance("SHA-1", MyTestProvider.NAME);
assertEquals(MyTestProvider... | 1 |
[CLS] public void jsFunction_addFile(ScriptableFile infile) throws IOException {
if (!infile.jsFunction_exists()) throw new IllegalArgumentException("Cannot add a file that doesn't exists to an archive");
ZipArchiveEntry entry = new ZipArchiveEntry(infile.getName());
entry.setSize(infile.jsFunct... | 1 |
[CLS] public void copyFile(File sourceFile, File destFile) throws IOException {
if (!destFile.exists()) {
destFile.createNewFile();
}
FileChannel source = null;
FileChannel destination = null;
Closer c = new Closer();
try {
source = c.register(new ... | 1 |
[CLS] private void displayDiffResults() throws IOException {
File outFile = File.createTempFile("diff", ".htm");
outFile.deleteOnExit();
FileOutputStream outStream = new FileOutputStream(outFile);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outStream));
out.wri... | 1 |
[CLS] private static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOEx... | 1 |
[CLS] private void connect() throws Exception {
if (client != null) throw new IllegalStateException("Already connected.");
try {
_logger.debug("About to connect to ftp server " + server + " port " + port);
client = new FTPClient();
client.connect(server, port);
... | 0 |
[CLS] public void deleteGroupInstruction(int id, int rank) throws FidoDatabaseException, InstructionNotFoundException {
try {
Connection conn = null;
Statement stmt = null;
try {
conn = fido.util.FidoDataSource.getConnection();
conn.setAutoComm... | 1 |
[CLS] private String searchMetabolite(String name) {
{
BufferedReader in = null;
try {
String urlName = name;
URL url = new URL(urlName);
in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
... | 1 |
[CLS] public String GetMemberName(String id) {
String name = null;
try {
String line;
URL url = new URL(intvasmemberDeatails + "?CID=" + id);
URLConnection connection = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(... | 0 |
[CLS] public ViewedCandidates postViewedCandidates(ViewedCandidates viewedCandidates) throws BookKeeprCommunicationException {
try {
synchronized (httpClient) {
HttpPost req = new HttpPost(remoteHost.getUrl() + "/cand/viewed");
req.setHeader("Accept-Encoding", "gzip")... | 0 |
[CLS] public void putChunk(String chunk) throws JacsonException {
try {
URL url = new URL(chunk);
InputStream is = url.openStream();
if (inverse) drain.putChunk(chunk);
is.close();
} catch (IOException broken) {
if (!inverse) drain.putChunk(chu... | 0 |
[CLS] public List<PathObject> fetchPath(BoardObject board) throws NetworkException {
if (boardPathMap.containsKey(board.getId())) {
return boardPathMap.get(board.getId()).getChildren();
}
HttpClient client = HttpConfig.newInstance();
HttpGet get = new HttpGet(HttpConfig.bbsUR... | 0 |
[CLS] public static void copyFile(File inputFile, File outputFile) throws IOException {
FileChannel inChannel = null;
FileChannel outChannel = null;
try {
inChannel = new FileInputStream(inputFile).getChannel();
outChannel = new FileOutputStream(outputFile).getChannel();
... | 1 |
[CLS] public static URLConnection openRemoteDescriptionFile(String urlstr) throws MalformedURLException {
URL url = new URL(urlstr);
try {
URLConnection conn = url.openConnection();
conn.connect();
return conn;
} catch (Exception e) {
Config conf =... | 0 |
[CLS] public static void copyFile(String source, String destination, TimeSlotTracker timeSlotTracker) {
LOG.info("copying [" + source + "] to [" + destination + "]");
BufferedInputStream sourceStream = null;
BufferedOutputStream destStream = null;
try {
File destinationFile =... | 1 |
[CLS] public static String md5(String password) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(password.getBytes());
BigInteger hash = new BigInteger(1, md5.digest());
return hash.toString(16);
} catch (NoSuchAlgorithmException ex... | 1 |
[CLS] public static void copy(final String source, final String dest) {
final File s = new File(source);
final File w = new File(dest);
try {
final FileInputStream in = new FileInputStream(s);
final FileOutputStream out = new FileOutputStream(w);
int c;
... | 1 |
[CLS] public void truncateLog(long finalZxid) throws IOException {
long highestZxid = 0;
for (File f : dataDir.listFiles()) {
long zxid = isValidSnapshot(f);
if (zxid == -1) {
LOG.warn("Skipping " + f);
continue;
}
if (zxid ... | 1 |
[CLS] protected void update(String sql, Object[] args) {
Connection conn = null;
PreparedStatement pstmt = null;
try {
conn = JdbcUtils.getConnection();
conn.setAutoCommit(false);
pstmt = conn.prepareStatement(sql);
this.setParameters(pstmt, args);... | 0 |
[CLS] protected Object getMethodKey(String methodName, Object[] args) {
StringBuffer key = new StringBuffer(methodName.trim().replace(" ", ".")).append(".");
for (Object o : args) {
if (o != null) key.append(o.hashCode());
}
LOGGER.info("Generation key ->" + key.toString());
... | 0 |
[CLS] public static void copyFile(File sourceFile, File destFile) throws IOException {
if (!destFile.exists()) {
destFile.createNewFile();
}
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChanne... | 1 |
[CLS] public static void copy(FileInputStream source, FileOutputStream dest) throws IOException {
FileChannel in = null, out = null;
try {
in = source.getChannel();
out = dest.getChannel();
long size = in.size();
MappedByteBuffer buf = in.map(FileChannel.M... | 1 |
[CLS] private String hash(String message) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA1");
} catch (NoSuchAlgorithmException e) {
throw new AssertionError("Can't find the SHA1 algorithm in the java.security package");
}
String saltS... | 0 |
[CLS] private void loadMap() {
final String wordList = "vietwordlist.txt";
try {
File dataFile = new File(supportDir, wordList);
if (!dataFile.exists()) {
final ReadableByteChannel input = Channels.newChannel(ClassLoader.getSystemResourceAsStream("dict/" + dataFil... | 1 |
[CLS] private void parseExternalCss(Document d) throws XPathExpressionException, IOException {
InputStream is = null;
try {
XPath xp = xpf.newXPath();
XPathExpression xpe = xp.compile("//link[@type='text/css']/@href");
NodeList nl = (NodeList) xpe.evaluate(d, XPathCon... | 0 |
[CLS] @Override
public CelShadingModel loadModel(URL url, String skin) throws IOException, IncorrectFormatException, ParsingErrorException {
boolean baseURLWasNull = setBaseURLFromModelURL(url);
CelShadingModel model = loadModel(url.openStream(), skin);
if (baseURLWasNull) {
popB... | 0 |
[CLS] public static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOExc... | 1 |
[CLS] private void parseTemplate(File templateFile, Map dataMap) throws ContainerException {
Debug.log("Parsing template : " + templateFile.getAbsolutePath(), module);
Reader reader = null;
try {
reader = new InputStreamReader(new FileInputStream(templateFile));
} catch (File... | 0 |
[CLS] public static void copyURLToFile(URL source, File destination) throws IOException {
InputStream input = source.openStream();
try {
FileOutputStream output = openOutputStream(destination);
try {
IOUtils.copy(input, output);
} finally {
... | 1 |
[CLS] public static void copyFile(File src, File dst) throws IOException {
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) out.write(buf, 0, len);
in.close();
... | 1 |
[CLS] private void checkForNewVersion() {
try {
org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(net.xan.taskstack.TaskStackApp.class).getContext().getResourceMap(NewTaskDialog.class);
String versionUrl = resourceMap.getString("Applicati... | 0 |
[CLS] void bsort(int a[], int lo, int hi) throws Exception {
for (int j = hi; j > lo; j--) {
for (int i = lo; i < j; i++) {
if (a[i] > a[i + 1]) {
int T = a[i];
a[i] = a[i + 1];
a[i + 1] = T;
pause();
... | 0 |
[CLS] public void beforeMethod(TestBase testBase) throws IOException {
TFileFactory fileFactory = new TFileFactory(new InMemoryFileSystem());
ftpServer.cleanFileSystem(fileFactory);
TDirectory rootDir = fileFactory.dir("/");
testBase.inject(rootDir);
FTPClient ftpClient = new FTP... | 0 |
[CLS] @Deprecated
public void test() {
try {
String query = "* <http://xmlns.com/foaf/0.1/workplaceHomepage> <http://www.deri.ie/>" + "* <http://xmlns.com/foaf/0.1/knows> *";
String url = "http://sindice.com/api/v2/search?qt=advanced&q=" + URLEncoder.encode(query, "utf-8") + "&qt=adv... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.