id int32 0 901k | id1 int32 74 23.7M | id2 int32 74 23.7M | func1 stringlengths 234 68.5k | func2 stringlengths 234 68.5k | label bool 2
classes |
|---|---|---|---|---|---|
900,300 | 22,051,326 | 14,231,450 | public static LicenseKey parseKey(String key) throws InvalidLicenseKeyException {
final String f_key = key.trim();
StringTokenizer st = new StringTokenizer(f_key, FIELD_SEPERATOR);
int tc = st.countTokens();
int tc_name = tc - 9;
try {
final String product = st.ne... | public byte[] download(URL url, OutputStream out) throws IOException {
boolean returnByByteArray = (out == null);
ByteArrayOutputStream helper = null;
if (returnByByteArray) {
helper = new ByteArrayOutputStream();
}
String s = url.toExternalForm();
URLConn... | false |
900,301 | 916,271 | 6,305,269 | 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 = DcmObjectFactor... | protected void copyFile(File sourceFile, File destFile) {
FileChannel in = null;
FileChannel out = null;
try {
if (!verifyOrCreateParentPath(destFile.getParentFile())) {
throw new IOException("Parent directory path " + destFile.getAbsolutePath() + " did not exist ... | true |
900,302 | 19,380,360 | 14,037,891 | private void copyPhoto(final IPhoto photo, final Map.Entry<String, Integer> size) {
final File fileIn = new File(storageService.getPhotoPath(photo, storageService.getOriginalDir()));
final File fileOut = new File(storageService.getPhotoPath(photo, size.getKey()));
InputStream fileInputStream... | private void transformFile(File input, File output, Cipher cipher, boolean compress, String progressMessage) throws IOException {
FileInputStream fileInputStream = new FileInputStream(input);
InputStream inputStream;
if (progressMessage != null) {
inputStream = new ProgressMonito... | true |
900,303 | 20,432,606 | 17,930,256 | private void bokActionPerformed(java.awt.event.ActionEvent evt) {
if (this.meetingnamepanel.getEnteredValues().get(0).toString().trim().equals("")) {
this.showWarningMessage("Enter Meeting Name");
} else {
String[] patlib = newgen.presentation.NewGenMain.getAppletInstance().g... | private JButton getButtonImagen() {
if (buttonImagen == null) {
buttonImagen = new JButton();
buttonImagen.setText("Cargar Imagen");
buttonImagen.setIcon(new ImageIcon(getClass().getResource("/data/icons/view_sidetree.png")));
buttonImagen.addActionListener(ne... | false |
900,304 | 896,701 | 12,048,548 | 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 = DcmObjectFactor... | public static void exportDB(String input, String output) {
try {
Class.forName("org.sqlite.JDBC");
String fileName = input + File.separator + G.databaseName;
File dataBase = new File(fileName);
if (!dataBase.exists()) {
JOptionPane.showMessageD... | true |
900,305 | 17,402,775 | 9,713,536 | public String getResourceAsString(String name) throws IOException {
String content = null;
InputStream stream = aClass.getResourceAsStream(name);
if (stream != null) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
IOUtils.copyAndClose(stream, buffer);
... | @SuppressWarnings("unchecked")
private void doService(final HttpServletRequest request, final HttpServletResponse response) throws Exception {
final String url = request.getRequestURL().toString();
if (url.endsWith("/favicon.ico")) {
response.setStatus(HttpServlet... | true |
900,306 | 23,113,421 | 2,046,158 | public String getString(String arg) throws Exception {
URL url = new URL(arg);
URLConnection con = url.openConnection();
con.setUseCaches(false);
con.connect();
InputStreamReader src = new InputStreamReader(con.getInputStream(), "ISO-8859-1");
StringBuffer stb = new S... | String chooseHGVersion(String version) {
String line = "";
try {
URL connectURL = new URL("http://genome.ucsc.edu/cgi-bin/hgGateway?db=" + version);
InputStream urlStream = connectURL.openStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(u... | false |
900,307 | 2,544,868 | 3,024,984 | public String encode(String plain) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(plain.getBytes());
byte b[] = md.digest();
int i;
StringBuffer buf = new StringBuffer("");
for (int offset = 0; offset < b.length;... | @Test
public void testCopy_readerToOutputStream() throws Exception {
InputStream in = new ByteArrayInputStream(inData);
in = new YellOnCloseInputStreamTest(in);
Reader reader = new InputStreamReader(in, "US-ASCII");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
... | false |
900,308 | 17,286,897 | 13,521,323 | public void check() {
statusBar.setStatusText(Labels.getLabel("state.retrievingVersion"));
Runnable checkVersionCode = new Runnable() {
public void run() {
BufferedReader reader = null;
String message = null;
in... | public static void copyFile(final String inFile, final String outFile) {
FileChannel in = null;
FileChannel out = null;
try {
in = new FileInputStream(inFile).getChannel();
out = new FileOutputStream(outFile).getChannel();
in.transferTo(0, in.size(), out);... | false |
900,309 | 21,781,575 | 16,385,631 | private String loadSchemas() {
StringWriter writer = new StringWriter();
try {
IOUtils.copy(CoreOdfValidator.class.getResourceAsStream("schema_list.properties"), writer);
} catch (IOException e) {
e.printStackTrace();
}
return writer.toString();
}
| private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
System.out.println("Error: " + e);
}
... | false |
900,310 | 4,461,832 | 11,339,042 | @Test
public void testXMLDBURLStreamHandler() {
System.out.println("testXMLDBURLStreamHandler");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
URL url = new URL(XMLDB_URL_1);
InputStream is = url.openStream();
copyDocument(is, baos);
... | public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
PrintWriter out = null;
ServletOutputStream outstream = null;
try {
String action = req.getParameter("nmrshiftdbaction");
String relativepath = ServletUtils.expa... | false |
900,311 | 10,846,725 | 23,250,845 | private DataFileType[] getDataFiles(Collection<ContentToSend> contentsToSend) {
DataFileType[] files = new DataFileType[contentsToSend.size()];
int fileIndex = 0;
for (ContentToSend contentToSend : contentsToSend) {
DataFileType dataFile = DataFileType.Factory... | private void unzipResource(final String resourceName, final File targetDirectory) throws IOException {
assertTrue(resourceName.startsWith("/"));
final URL resource = this.getClass().getResource(resourceName);
assertNotNull("Expected '" + resourceName + "' not found.", resource);
asse... | true |
900,312 | 13,815,966 | 20,587,078 | private void getRdfResponse(StringBuilder sb, String url) {
try {
String inputLine = null;
BufferedReader reader = new BufferedReader(new InputStreamReader(new URL(url).openStream()));
while ((inputLine = reader.readLine()) != null) {
sb.append(inputLine);... | public static void main(String[] a) {
ArrayList<String> allFilesToBeCopied = new ArrayList<String>();
new File(outputDir).mkdirs();
try {
FileReader fis = new FileReader(completeFileWithDirToCathFileList);
BufferedReader bis = new BufferedReader(fis);
Stri... | false |
900,313 | 17,597,668 | 2,532,322 | private boolean copyFiles(File sourceDir, File destinationDir) {
boolean result = false;
try {
if (sourceDir != null && destinationDir != null && sourceDir.exists() && destinationDir.exists() && sourceDir.isDirectory() && destinationDir.isDirectory()) {
File sourceFiles[]... | public static boolean decodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base64.... | true |
900,314 | 13,927,065 | 8,544,627 | void copyFile(File src, File dst) throws IOException {
FileInputStream fis = new FileInputStream(src);
byte[] buf = new byte[10000];
int n;
FileOutputStream fos = new FileOutputStream(dst);
while ((n = fis.read(buf)) > 0) fos.write(buf, 0, n);
fis.close();
fos... | @Override
protected void copyContent(String filename) throws IOException {
InputStream in = null;
try {
in = LOADER.getResourceAsStream(RES_PKG + filename);
ByteArrayOutputStream out = new ByteArrayOutputStream();
IOUtils.copy(in, o... | true |
900,315 | 14,540,145 | 7,038,631 | public void copyFile(String source_name, String dest_name) throws IOException {
File source_file = new File(source_name);
File destination_file = new File(dest_name);
Reader source = null;
Writer destination = null;
char[] buffer;
int bytes_read;
try {
... | private FileLog(LOG_LEVEL displayLogLevel, LOG_LEVEL logLevel, String logPath) {
this.logLevel = logLevel;
this.displayLogLevel = displayLogLevel;
if (null != logPath) {
logFile = new File(logPath, "current.log");
log(LOG_LEVEL.DEBUG, "FileLog", "Initialising logfile ... | true |
900,316 | 13,131,643 | 1,416,342 | public void init(File file) {
InputStream is = null;
ByteArrayOutputStream os = null;
try {
is = new FileInputStream(file);
os = new ByteArrayOutputStream();
IOUtils.copy(is, os);
} catch (Throwable e) {
throw new VisualizerEngineExcept... | public void run() {
for (int i = 0; i < iClNumberOfCycles; i++) {
try {
long lStartTime = System.currentTimeMillis();
InputStream in = urlClDestinationURL.openStream();
byte buf[] = new byte[1024];
int num;
while ((n... | false |
900,317 | 8,506,682 | 23,411,500 | public static File getFileFromURL(URL url) {
File tempFile;
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
String tempDir = System.getProperty("java.io.tmpdir", ".");
tempFile = File.createTempFile("xxindex", ".tmp", new File(tempDir));
... | public void playSIDFromHVSC(String name) {
player.reset();
player.setStatus("Loading song: " + name);
URL url;
try {
if (name.startsWith("/")) {
name = name.substring(1);
}
url = getResource(hvscBase + name);
if (player.... | false |
900,318 | 10,047,344 | 4,317,626 | public static void main(String[] args) {
LogFrame.getInstance();
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (arg.trim().startsWith(DEBUG_PARAMETER_NAME + "=")) {
properties.put(DEBUG_PARAMETER_NAME, arg.trim().substring(DEBUG_PARAMETER_NA... | public static synchronized String hash(String data) {
if (digest == null) {
try {
digest = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException nsae) {
System.err.println("Failed to load the SHA-1 MessageDigest. " + "Jive will be unabl... | false |
900,319 | 20,006,636 | 945,981 | public void trimAndWriteNewSff(OutputStream out) throws IOException {
TrimParser trimmer = new TrimParser();
SffParser.parseSFF(untrimmedSffFile, trimmer);
tempOut.close();
headerBuilder.withNoIndex().numberOfReads(numberOfTrimmedReads);
SffWriter.writeCommonHeader(headerBuil... | 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.write... | true |
900,320 | 7,237,618 | 22,051,326 | 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 (IOExcep... | public static LicenseKey parseKey(String key) throws InvalidLicenseKeyException {
final String f_key = key.trim();
StringTokenizer st = new StringTokenizer(f_key, FIELD_SEPERATOR);
int tc = st.countTokens();
int tc_name = tc - 9;
try {
final String product = st.ne... | false |
900,321 | 1,092,728 | 4,245,652 | public String encodePassword(String rawPass, Object salt) {
MessageDigest sha;
try {
sha = MessageDigest.getInstance("SHA");
} catch (java.security.NoSuchAlgorithmException e) {
throw new LdapDataAccessException("No SHA implementation available!");
}
s... | public InputStream getExportFile() {
URL url = ExportAction.class.getClassLoader().getResource("sysConfig.xml");
if (url != null) try {
return url.openStream();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
| false |
900,322 | 9,439,748 | 16,227,459 | public static void transfer(FileInputStream fileInStream, FileOutputStream fileOutStream) throws IOException {
FileChannel fileInChannel = fileInStream.getChannel();
FileChannel fileOutChannel = fileOutStream.getChannel();
long fileInSize = fileInChannel.size();
try {
lon... | public CmsSetupTestResult execute(CmsSetupBean setupBean) {
CmsSetupTestResult testResult = new CmsSetupTestResult(this);
String basePath = setupBean.getWebAppRfsPath();
if (!basePath.endsWith(File.separator)) {
basePath += File.separator;
}
File file1;
Ra... | true |
900,323 | 98,428 | 16,380,120 | public static XMLShowInfo NzbSearch(TVRageShowInfo tvrage, XMLShowInfo xmldata, int latestOrNext) {
String newzbin_query = "", csvData = "", hellaQueueDir = "", newzbinUsr = "", newzbinPass = "";
String[] tmp;
DateFormat tvRageDateFormat = new SimpleDateFormat("MMM/dd/yyyy");
DateFor... | @Override
public String compute_hash(String plaintext) {
MessageDigest d;
try {
d = MessageDigest.getInstance(get_algorithm_name());
d.update(plaintext.getBytes());
byte[] hash = d.digest();
StringBuffer sb = new StringBuffer();
for (by... | false |
900,324 | 13,873,860 | 12,863,885 | static byte[] genDigest(String pad, byte[] passwd) throws NoSuchAlgorithmException {
MessageDigest digest = MessageDigest.getInstance(DIGEST_ALGORITHM);
digest.update(pad.getBytes());
digest.update(passwd);
return digest.digest();
}
| private static String md5(String input) {
String res = "";
try {
MessageDigest cript = MessageDigest.getInstance("MD5");
cript.reset();
cript.update(input.getBytes());
byte[] md5 = cript.digest();
String tmp = "";
for (int i = 0... | true |
900,325 | 6,146,145 | 14,193,058 | public void testSystemPropertyConnector() throws Exception {
final String rootFolderPath = "test/ConnectorTest/fs/".toLowerCase();
final Connector connector = new SystemPropertyConnector();
final ContentResolver contentResolver = new UnionContentResolver();
final FSContentResolver fs... | public static String submitURLRequest(String url) throws HttpException, IOException, URISyntaxException {
HttpClient httpclient = new DefaultHttpClient();
InputStream stream = null;
user_agents = new LinkedList<String>();
user_agents.add("Mozilla/5.0 (Windows; U; Windows NT 6.1; en-U... | false |
900,326 | 5,828,731 | 10,852,631 | public static void resize(File originalFile, File resizedFile, int width, String format) throws IOException {
if (format != null && "gif".equals(format.toLowerCase())) {
resize(originalFile, resizedFile, width, 1);
return;
}
FileInputStream fis = new FileInputStream(o... | private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
final StringBuilder sbValueBeforeMD5 = new StringBuilder();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
logger.fatal("", e);
return;
... | false |
900,327 | 4,208,869 | 16,944,401 | public static void putNextJarEntry(JarOutputStream modelStream, String name, File file) throws IOException {
JarEntry entry = new JarEntry(name);
entry.setSize(file.length());
modelStream.putNextEntry(entry);
InputStream fileStream = new BufferedInputStream(new FileInputStream(file))... | public static void copyFile(File in, File out) throws IOException {
FileChannel sourceChannel = new FileInputStream(in).getChannel();
FileChannel destinationChannel = new FileOutputStream(out).getChannel();
try {
sourceChannel.transferTo(0, sourceChannel.size(), destinationChanne... | true |
900,328 | 15,737,835 | 7,419,810 | public void add(Site site) throws Exception {
DBOperation dbo = null;
Connection connection = null;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
try {
String sqlStr = "insert into t_ip_site (id,name,description,ascii_name,site_path,remar... | static void test() throws SQLException {
Connection conn = null;
Statement st = null;
ResultSet rs = null;
Savepoint sp = null;
try {
conn = JdbcUtils.getConnection();
conn.setAutoCommit(false);
st = conn.createStatement();
Stri... | true |
900,329 | 23,370,620 | 4,491,957 | private File prepareFileForUpload(File source, String s3key) throws IOException {
File tmp = File.createTempFile("dirsync", ".tmp");
tmp.deleteOnExit();
InputStream in = null;
OutputStream out = null;
try {
in = new FileInputStream(source);
out = new D... | public void copyToCurrentDir(File _copyFile, String _fileName) throws IOException {
File outputFile = new File(getCurrentPath() + File.separator + _fileName);
FileReader in;
FileWriter out;
if (!outputFile.exists()) {
outputFile.createNewFile();
}
in = new... | true |
900,330 | 18,573,528 | 14,869,434 | public int process(ProcessorContext context) throws InterruptedException, ProcessorException {
logger.info("JAISaveTask:process");
final RenderedOp im = (RenderedOp) context.get("RenderedOp");
final String path = "s3://s3.amazonaws.com/rssfetch/" + (new Guid());
final PNGEncodeParam.... | @Override
public void run() {
try {
FileChannel in = new FileInputStream(inputfile).getChannel();
long pos = 0;
for (int i = 1; i <= noofparts; i++) {
FileChannel out = new FileOutputStream(outputfile.getAbsolutePath() + "." + "v" + i).getChannel();
... | true |
900,331 | 11,604,443 | 1,023,289 | private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer(128);
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
logger.error("Error: " + e);
}
tr... | public static String MD5(String s) {
try {
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(s.getBytes(), 0, s.length());
return new BigInteger(1, m.digest()).toString(16);
} catch (NoSuchAlgorithmException ex) {
return "";
}
}
| true |
900,332 | 14,350,198 | 14,284,458 | 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());
... | private String md5(String txt) {
try {
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(txt.getBytes(), 0, txt.length());
return new BigInteger(1, m.digest()).toString(16);
} catch (Exception e) {
return "BAD MD5";
}
}
| true |
900,333 | 13,131,643 | 8,665,322 | public void init(File file) {
InputStream is = null;
ByteArrayOutputStream os = null;
try {
is = new FileInputStream(file);
os = new ByteArrayOutputStream();
IOUtils.copy(is, os);
} catch (Throwable e) {
throw new VisualizerEngineExcept... | public Vector<String> getVoiceServersNames() {
Vector<String> result = new Vector<String>();
boolean serverline = false;
String line;
String[] splitline;
try {
URL url = new URL(voiceaddress);
URLConnection connection = url.openConnection();
... | false |
900,334 | 5,021,563 | 1,039,796 | private String AddAction(ResultSet node, String modo) throws SQLException {
Connection cn = null;
Connection cndef = null;
String schema = boRepository.getDefaultSchemaName(boApplication.getDefaultApplication()).toLowerCase();
try {
cn = this.getRepositoryConnection(p_ctx... | public static void insert(Connection c, MLPApprox net, int azioneId, String descrizione, int[] indiciID, int output, Date from, Date to) throws SQLException {
try {
PreparedStatement ps = c.prepareStatement(insertNet, PreparedStatement.RETURN_GENERATED_KEYS);
ArrayList<Integer> index... | true |
900,335 | 10,690,728 | 20,601,754 | private void addMaintainerScripts(TarOutputStream tar, PackageInfo info) throws IOException, ScriptDataTooLargeException {
for (final MaintainerScript script : info.getMaintainerScripts().values()) {
if (script.getSize() > Integer.MAX_VALUE) {
throw new ScriptDataTooLargeExceptio... | public static File copyFile(File file, String dirName) {
File destDir = new File(dirName);
if (!destDir.exists() || !destDir.isDirectory()) {
destDir.mkdirs();
}
File src = file;
File dest = new File(dirName, src.getName());
try {
if (!dest.exi... | true |
900,336 | 17,456,565 | 9,195,362 | public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base64.... | public static long copy(File src, File dest) throws UtilException {
FileChannel srcFc = null;
FileChannel destFc = null;
try {
srcFc = new FileInputStream(src).getChannel();
destFc = new FileOutputStream(dest).getChannel();
long srcLength = srcFc.size();
... | true |
900,337 | 21,456,138 | 17,228,897 | @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "getServerCertificates", args = { })
public final void test_getServerCertificates() throws Exception {
try {
URL url = new URL("https://localhost:55555");
HttpsURLConnection connection = (HttpsURLConnection) url.ope... | public static boolean doPost(String urlString, Map<String, String> nameValuePairs) throws IOException {
URL url = new URL(urlString);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
PrintWriter out = new PrintWriter(conn.getOutputStream());
boolean first = ... | false |
900,338 | 22,307,323 | 20,696,811 | public static String cryptSha(String target) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(target.getBytes("UTF-16"));
BigInteger res = new BigInteger(1, md.digest(key.getBytes()));
return res.toString(1... | private static boolean insereTutorial(final Connection con, final Tutorial tut, final Autor aut, final Descricao desc) {
try {
con.setAutoCommit(false);
Statement smt = con.createStatement();
if (aut.getCodAutor() == 0) {
GeraID.gerarCodAutor(con, aut);
... | false |
900,339 | 12,838,274 | 16,351,775 | public BufferedImage extract() throws DjatokaException {
boolean useRegion = false;
int left = 0;
int top = 0;
int width = 50;
int height = 50;
boolean useleftDouble = false;
Double leftDouble = 0.0;
boolean usetopDouble = false;
Double topDoub... | public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base64.... | true |
900,340 | 19,556,732 | 15,607,084 | public boolean verifySignature() {
try {
byte[] data = readFile(name + ".tmp1.bin");
if (data == null) return false;
if (data[data.length - 0x104] != 'N' || data[data.length - 0x103] != 'G' || data[data.length - 0x102] != 'I' || data[data.length - 0x101] != 'S') return fa... | protected void copyFile(String inputFilePath, String outputFilePath) throws GenerationException {
String from = getTemplateDir() + inputFilePath;
try {
logger.debug("Copying from " + from + " to " + outputFilePath);
InputStream inputStream = Thread.currentThread().getContextC... | false |
900,341 | 11,922,877 | 9,543,284 | private void chooseGame(DefaultHttpClient httpclient) throws IOException, ClientProtocolException {
HttpGet httpget = new HttpGet(Constants.STRATEGICDOMINATION_URL + "/gameboard.cgi?gameid=" + 1687);
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity(... | public static final void copyFile(String srcFilename, String dstFilename) throws IOException {
FileInputStream fis = null;
FileOutputStream fos = null;
FileChannel ifc = null;
FileChannel ofc = null;
Util.copyBuffer.clear();
try {
fis = new FileInputStream... | true |
900,342 | 8,071,138 | 19,565,153 | public void sendContent(OutputStream out, Range range, Map map, String string) throws IOException, NotAuthorizedException, BadRequestException {
System.out.println("sendContent " + file);
RFileInputStream in = new RFileInputStream(file);
try {
IOUtils.copyLarge(in, out);
... | private void copy(File fin, File fout) throws IOException {
FileOutputStream out = new FileOutputStream(fout);
FileInputStream in = new FileInputStream(fin);
byte[] buf = new byte[2048];
int read = in.read(buf);
while (read > 0) {
out.write(buf, 0, read);
... | true |
900,343 | 6,147,227 | 18,985,881 | public static String[] putFECSplitFile(String uri, File file, int htl, boolean mode) {
FcpFECUtils fecutils = null;
Vector segmentHeaders = null;
Vector segmentFileMaps = new Vector();
Vector checkFileMaps = new Vector();
Vector segmentKeyMaps = new Vector();
Vector c... | public static final String crypt(String password, String salt) throws NoSuchAlgorithmException {
String magic = "$1$";
byte finalState[];
MessageDigest ctx, ctx1;
long l;
if (salt.startsWith(magic)) {
salt = salt.substring(magic.length());
}
if (sa... | false |
900,344 | 1,023,289 | 15,288,212 | public static String MD5(String s) {
try {
MessageDigest m = MessageDigest.getInstance("MD5");
m.update(s.getBytes(), 0, s.length());
return new BigInteger(1, m.digest()).toString(16);
} catch (NoSuchAlgorithmException ex) {
return "";
}
}
| protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
GraphicalViewer viewer = getGraphicalViewer();
viewer.setEditPartFactory(createEditPartFactory());
ScalableRootEditPart rootEditPart = new ScalableRootEditPart();
viewer.setRootEditPart(rootEditPart... | false |
900,345 | 17,486,397 | 4,531,654 | public static String getUserToken(String userName) {
if (userName != null && userName.trim().length() > 0) try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update((userName + seed).getBytes("ISO-8859-1"));
return BaseController.bytesToHex(md.digest());
... | public static byte[] md5raw(String data) {
try {
MessageDigest md = MessageDigest.getInstance(MD);
md.update(data.getBytes(UTF8));
return md.digest();
} catch (Exception e) {
throw new RuntimeException(e);
}
}
| true |
900,346 | 4,594,844 | 7,911,395 | @Override
public void execute() throws BuildException {
final String GC_USERNAME = "google-code-username";
final String GC_PASSWORD = "google-code-password";
if (StringUtils.isBlank(this.projectName)) throw new BuildException("undefined project");
if (this.file == null) throw new... | public void executaAlteracoes() {
Album album = Album.getAlbum();
Photo[] fotos = album.getFotos();
Photo f;
int ultimoFotoID = -1;
int albumID = album.getAlbumID();
sucesso = true;
PainelWebFotos.setCursorWait(true);
albumID = recordAlbumData(album, a... | true |
900,347 | 17,638,222 | 15,376,025 | public static void copyFile(final File sourceFile, final File destFile) throws IOException {
if (!destFile.exists()) destFile.createNewFile();
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChannel();
... | @Override
protected svm_model loadModel(InputStream inputStream) throws IOException {
File tmpFile = File.createTempFile("tmp", ".mdl");
FileOutputStream output = new FileOutputStream(tmpFile);
try {
IOUtils.copy(inputStream, output);
return libsvm.svm.svm_load_mo... | true |
900,348 | 9,639,432 | 10,207,808 | private static String deviceIdFromCombined_Device_ID(Context context) {
StringBuilder builder = new StringBuilder();
builder.append(deviceIdFromIMEI(context));
builder.append(deviceIdFromPseudo_Unique_Id());
builder.append(deviceIdFromAndroidId(context));
builder.append(devic... | @SuppressWarnings("finally")
private void compress(File src) throws IOException
{
if (this.switches.contains(Switch.test))
return;
checkSourceFile(src);
if (src.getPath().endsWith(".bz2"))
{
this.log.println("WARNING: skipping file because it already has .bz2 suffix:").println(src);
... | false |
900,349 | 2,284,080 | 15,831,694 | private static void copy(String srcFilename, String dstFilename, boolean override) throws IOException, XPathFactoryConfigurationException, SAXException, ParserConfigurationException, XPathExpressionException {
File fileToCopy = new File(rootDir + "test-output/" + srcFilename);
if (fileToCopy.exists(... | 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 (IOExcep... | true |
900,350 | 16,788,944 | 11,683,526 | private void refreshCacheFile(RepositoryFile file, File cacheFile) throws FileNotFoundException, IOException {
FileOutputStream fos = new FileOutputStream(cacheFile);
InputStream is = file.getInputStream();
int count = IOUtils.copy(is, fos);
logger.debug("============================... | private static boolean moveFiles(String sourceDir, String targetDir) {
boolean isFinished = false;
boolean fileMoved = false;
File stagingDir = new File(sourceDir);
if (!stagingDir.exists()) {
System.out.println(getTimeStamp() + "ERROR - source directory does not exist.")... | true |
900,351 | 11,519,124 | 21,722,036 | protected static void copyFile(File in, File out) throws IOException {
java.io.FileWriter filewriter = null;
java.io.FileReader filereader = null;
try {
filewriter = new java.io.FileWriter(out);
filereader = new java.io.FileReader(in);
char[] buf = new cha... | public void loadXML(URL flux, int status, File file) {
try {
SAXBuilder sbx = new SAXBuilder();
try {
if (file.exists()) {
file.delete();
}
if (!file.exists()) {
URLConnection conn = flux.openConn... | true |
900,352 | 11,090,449 | 11,673,911 | public static Drawable fetchCachedDrawable(String url) throws MalformedURLException, IOException {
Log.d(LOG_TAG, "Fetching cached : " + url);
String cacheName = md5(url);
checkAndCreateDirectoryIfNeeded();
File r = new File(CACHELOCATION + cacheName);
if (!r.exists()) {
... | private void _save(ActionRequest req, ActionResponse res, PortletConfig config, ActionForm form) throws Exception {
List list = (List) req.getAttribute(WebKeys.LANGUAGE_MANAGER_LIST);
for (int i = 0; i < list.size(); i++) {
long langId = ((Language) list.get(i)).getId();
try ... | true |
900,353 | 16,841,577 | 4,684,601 | public int read(String name) {
status = STATUS_OK;
try {
name = name.trim();
if (name.indexOf("://") > 0) {
URL url = new URL(name);
in = new BufferedInputStream(url.openStream());
} else {
in = new BufferedInputStre... | 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 (IOExcep... | false |
900,354 | 21,519,782 | 13,713,980 | protected static void copyDeleting(File source, File dest) throws ErrorCodeException {
byte[] buf = new byte[8 * 1024];
FileInputStream in = null;
try {
in = new FileInputStream(source);
try {
FileOutputStream out = new FileOutputStream(dest);
... | private String sendMessage(HttpURLConnection connection, String reqMessage) throws IOException, XMLStreamException {
if (msgLog.isTraceEnabled()) msgLog.trace("Outgoing SOAPMessage\n" + reqMessage);
BufferedOutputStream out = new BufferedOutputStream(connection.getOutputStream());
out.write(... | true |
900,355 | 19,145,296 | 13,719,500 | public static double[][] getCurrency() throws IOException {
URL url = new URL("http://hk.finance.yahoo.com/currency");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), "big5"));
double currency[][] = new double[11][11];
while (true) {
String ... | private void onDhReply(final SshDhReply msg) throws GeneralSecurityException, IOException {
if ((this.keyPair == null) || this.connection.isServer()) throw new SshException("%s: unexpected %s", this.connection.uri, msg.getType());
final BigInteger k;
{
final DHPublicKeySpec remot... | false |
900,356 | 13,747,998 | 16,006,791 | public DefaultMainControl(@NotNull final FileFilter scriptFileFilter, @NotNull final String scriptExtension, @NotNull final String scriptName, final int spellType, @Nullable final String spellFile, @NotNull final String scriptsDir, final ErrorView errorView, @NotNull final EditorFactory<G, A, R> editorFactory, fina... | public void print(PrintWriter out) {
out.println("<?xml version=\"1.0\"?>\n" + "<?xml-stylesheet type=\"text/xsl\" href=\"http://www.urbigene.com/foaf/foaf2html.xsl\" ?>\n" + "<rdf:RDF \n" + "xml:lang=\"en\" \n" + "xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" \n" + "xmlns:rdfs=\"http://www.w3.... | false |
900,357 | 7,466,372 | 821,218 | public void save(UploadedFile file, Long student, Long activity) {
File destiny = new File(fileFolder, student + "_" + activity + "_" + file.getFileName());
try {
IOUtils.copy(file.getFile(), new FileOutputStream(destiny));
} catch (IOException e) {
throw new RuntimeE... | public Configuration(URL url) {
InputStream in = null;
try {
load(in = url.openStream());
} catch (Exception e) {
throw new RuntimeException("Could not load configuration from " + url, e);
} finally {
if (in != null) {
try {
... | false |
900,358 | 15,917,727 | 19,660,641 | public static synchronized String hash(String data) {
if (digest == null) {
try {
digest = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException nsae) {
nsae.printStackTrace();
}
}
try {
digest.up... | public static String MD5_hex(String p) {
MessageDigest md;
try {
md = MessageDigest.getInstance("MD5");
md.update(p.getBytes());
BigInteger hash = new BigInteger(1, md.digest());
String ret = hash.toString(16);
return ret;
} catch (... | true |
900,359 | 19,483,244 | 11,548,510 | public static void copyFile(String original, String destination) throws Exception {
File original_file = new File(original);
File destination_file = new File(destination);
if (!original_file.exists()) throw new Exception("File with path " + original + " does not exist.");
if (destina... | public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base64.... | true |
900,360 | 16,236,980 | 23,098,143 | public void loadProperties() {
try {
java.util.Properties props = new java.util.Properties();
java.net.URL url = ClassLoader.getSystemResource("env.properties");
props.load(url.openStream());
this.proxyCertificatePath = props.getProperty("proxy.certificate.pat... | public void process() {
try {
update("Shutdown knowledge base ...", 0);
DBHelper.shutdownDB();
update("Shutdown knowledge base ...", 9);
String zipDir = P.DIR.getPKBDataPath();
update("Backup in progress ...", 10);
List<String> fileList... | false |
900,361 | 190,292 | 13,713,980 | private static void main(String[] args) {
try {
File f = new File("test.txt");
if (f.exists()) {
throw new IOException(f + " already exists. I don't want to overwrite it.");
}
StraightStreamReader in;
char[] cbuf = new char[0x1000]... | private String sendMessage(HttpURLConnection connection, String reqMessage) throws IOException, XMLStreamException {
if (msgLog.isTraceEnabled()) msgLog.trace("Outgoing SOAPMessage\n" + reqMessage);
BufferedOutputStream out = new BufferedOutputStream(connection.getOutputStream());
out.write(... | true |
900,362 | 6,424,937 | 14,190,765 | public void writeTo(OutputStream out) throws IOException {
if (!closed) {
throw new IOException("Stream not closed");
}
if (isInMemory()) {
memoryOutputStream.writeTo(out);
} else {
FileInputStream fis = new FileInputStream(outputFile);
... | private void _PostParser(Document document, AnnotationManager annoMan, Document htmldoc, String baseurl) {
xformer = annoMan.getTransformer();
builder = annoMan.getBuilder();
String annohash = "";
if (document == null) return;
NodeList ndlist = document.getElementsByTagNameNS... | false |
900,363 | 3,667,135 | 4,615,986 | public void fileCopy(File inFile, File outFile) {
try {
FileInputStream in = new FileInputStream(inFile);
FileOutputStream out = new FileOutputStream(outFile);
int c;
while ((c = in.read()) != -1) out.write(c);
in.close();
out.close();
... | public void processAction(DatabaseAdapter db_, DataDefinitionActionDataListType parameters) throws Exception {
PreparedStatement ps = null;
try {
if (log.isDebugEnabled()) log.debug("db connect - " + db_.getClass().getName());
String seqName = DefinitionService.getString(para... | false |
900,364 | 20,453,777 | 15,958,994 | private static List retrieveQuotes(Report report, Symbol symbol, TradingDate startDate, TradingDate endDate) throws ImportExportException {
List quotes = new ArrayList();
String URLString = constructURL(symbol, startDate, endDate);
EODQuoteFilter filter = new YahooEODQuoteFilter(symbol);
... | public String loadURLString(java.net.URL url) {
try {
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
StringBuffer buf = new StringBuffer();
String s = "";
while (br.ready() && s != null) {
s = br.readLine();
... | true |
900,365 | 14,497,172 | 131,811 | public String getHtml(String path) throws Exception {
URL url = new URL(path);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
InputStream inputStream = conn.getInputStream();
InputStreamReader isr = new InputStreamReader(inputStream, "UTF-8");
Stri... | 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 = p... | false |
900,366 | 10,106,969 | 1,914,865 | public static String md5(String value) throws NoSuchAlgorithmException {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
try {
messageDigest.update(value.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
messageDigest.update(value.getBytes... | public String hash(String plainTextPassword) {
try {
MessageDigest digest = MessageDigest.getInstance(digestAlgorithm);
digest.update(plainTextPassword.getBytes(charset));
byte[] rawHash = digest.digest();
return new String(Hex.encodeHex(rawHash));
} c... | true |
900,367 | 21,570,957 | 6,697,724 | private static long saveAndClosePDFDocument(PDDocument document, OutputStreamProvider outProvider) throws IOException, COSVisitorException {
File tempFile = null;
InputStream in = null;
OutputStream out = null;
try {
tempFile = File.createTempFile("temp", "pdf");
... | private void copyFile(File sourceFile, File targetFile) {
beNice();
dispatchEvent(SynchronizationEventType.FileCopy, sourceFile, targetFile);
File temporaryFile = new File(targetFile.getPath().concat(".jnstemp"));
while (temporaryFile.exists()) {
try {
beN... | true |
900,368 | 2,057,012 | 3,342,342 | private void loadProperties() {
if (properties == null) {
properties = new Properties();
try {
URL url = getClass().getResource(propsFile);
properties.load(url.openStream());
} catch (IOException ioe) {
ioe.printStackTrace()... | private void downloadPhoto(File photo, String url) {
try {
HttpClient httpClient = new DefaultHttpClient();
Log.v(TAG, "Dowloading photo from " + Server.URL + url);
HttpGet request = new HttpGet(Server.URL + url);
HttpResponse response = httpClient.execute(req... | false |
900,369 | 13,498,122 | 22,580,642 | public boolean createUser(String username, String password, String name) throws Exception {
boolean user_created = false;
try {
statement = connect.prepareStatement("SELECT COUNT(*) from toepen.users WHERE username = ? LIMIT 1");
statement.setString(1, username);
... | @Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
long startTime = System.currentTimeMillis();
boolean validClient = true;
boolean validSession = false;
String sessionKey = req.getParameter("sid");
Str... | true |
900,370 | 16,529,002 | 441,377 | public static boolean copy(File source, File dest) {
FileChannel in = null, out = null;
try {
in = new FileInputStream(source).getChannel();
out = new FileOutputStream(dest).getChannel();
long size = in.size();
MappedByteBuffer buf = in.map(FileChannel... | 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 = p... | true |
900,371 | 14,288,802 | 521,113 | static Object read(String path, String encoding, boolean return_string) throws IOException {
InputStream in;
if (path.startsWith("classpath:")) {
path = path.substring("classpath:".length());
URL url = Estimate.class.getClassLoader().getResource(path);
if (url == ... | int[] slowSort() {
int[] values = getValues();
int n = values.length;
for (int pass = 1; pass < n; pass++) {
for (int i = 0; i < n - pass; i++) {
if (values[i] > values[i + 1]) {
int temp = values[i];
values[i] = values[i + ... | false |
900,372 | 189,986 | 16,646,632 | public void elimina(Cliente cli) throws errorSQL, errorConexionBD {
System.out.println("GestorCliente.elimina()");
int id = cli.getId();
String sql;
Statement stmt = null;
try {
gd.begin();
sql = "DELETE FROM cliente WHERE cod_cliente =" + id;
... | public static BufferedReader getReader(int license) {
URL url = getResource(license);
if (url == null) return null;
InputStream inStream;
try {
inStream = url.openStream();
} catch (IOException e) {
return null;
}
return new BufferedRea... | false |
900,373 | 21,246,898 | 682,785 | public static void main(String[] args) throws ParseException, FileNotFoundException, IOException {
InputStream input = new BufferedInputStream(UpdateLanguages.class.getResourceAsStream("definition_template"));
Translator t = new Translator(input, "UTF8");
Node template = Translator.Start();
... | 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 = p... | true |
900,374 | 14,773,781 | 4,076,627 | public void testJPEGBuffImage() throws MalformedURLException, IOException {
System.out.println("JPEGCodec BufferedImage:");
long start = Calendar.getInstance().getTimeInMillis();
for (int i = 0; i < images.length; i++) {
String url = Constants.getDefaultURIMediaConnectorBasePath(... | public void openFtpConnection(String workingDirectory) throws RQLException {
try {
ftpClient = new FTPClient();
ftpClient.connect(server);
ftpClient.login(user, password);
ftpClient.changeWorkingDirectory(workingDirectory);
} catch (IOException ioex) {... | false |
900,375 | 18,548,122 | 12,678,042 | private static String loadUrlToString(String a_url) throws IOException {
URL l_url1 = new URL(a_url);
BufferedReader br = new BufferedReader(new InputStreamReader(l_url1.openStream()));
String l_content = "";
String l_ligne = null;
l_content = br.readLine();
while ((l... | private void addEMInformation() {
try {
long emDate = System.currentTimeMillis();
if (_local == true) {
File emFile = new File("emprotz.dat");
if (!emFile.exists()) {
return;
}
emDate = emFile.lastMod... | true |
900,376 | 10,207,809 | 15,609,433 | @SuppressWarnings("finally")
private void decompress(final File src) throws IOException
{
final String srcPath = src.getPath();
checkSourceFile(src);
final boolean test = this.switches.contains(Switch.test);
final File dst;
if (test)
dst = File.createTempFile("jaxlib-bzip", null);
e... | public static int[] bubbleSort2(int[] source) {
if (null != source && source.length > 0) {
boolean flag = false;
while (!flag) {
for (int i = 0; i < source.length - 1; i++) {
if (source[i] > source[i + 1]) {
int temp = sourc... | false |
900,377 | 833,870 | 7,041,871 | public static void test(String args[]) {
int trace;
int bytes_read = 0;
int last_contentLenght = 0;
try {
BufferedReader reader;
URL url;
url = new URL(args[0]);
URLConnection istream = url.openConnection();
last_contentLeng... | public static void bubbleSort(int[] array) {
for (int i = 0; i < array.length - 1; i++) {
for (int j = 0; j < array.length - i - 1; j++) {
if (array[j] > array[j + 1]) {
int temp = array[j];
array[j] = array[j + 1];
arra... | false |
900,378 | 7,893,892 | 2,883,828 | public static String md5EncodeString(String s) throws UnsupportedEncodingException, NoSuchAlgorithmException {
if (s == null) return null;
if (StringUtils.isBlank(s)) return "";
MessageDigest algorithm = MessageDigest.getInstance("MD5");
algorithm.reset();
algorithm.update(s.... | public static void copyFile(File from, File to) {
try {
FileInputStream in = new FileInputStream(from);
FileOutputStream out = new FileOutputStream(to);
byte[] buffer = new byte[1024 * 16];
int read = 0;
while ((read = i... | false |
900,379 | 5,113,796 | 19,309,675 | private BibtexDatabase importInspireEntries(String key, OutputPrinter frame) {
String url = constructUrl(key);
try {
HttpURLConnection conn = (HttpURLConnection) (new URL(url)).openConnection();
conn.setRequestProperty("User-Agent", "Jabref");
InputStream inputStr... | public final void propertyChange(final PropertyChangeEvent event) {
if (fChecker != null && event.getProperty().equals(ISpellCheckPreferenceKeys.SPELLING_USER_DICTIONARY)) {
if (fUserDictionary != null) {
fChecker.removeDictionary(fUserDictionary);
fUserDictionary... | false |
900,380 | 5,759,962 | 9,782,242 | @Override
public User login(String username, String password) {
User user = null;
try {
user = (User) em.createQuery("Select o from User o where o.username = :username").setParameter("username", username).getSingleResult();
} catch (NoResultException e) {
throw ne... | private void createUser(AddEditUserForm addform, HttpServletRequest request, ActionMapping mapping) throws Exception {
MessageDigest md = (MessageDigest) MessageDigest.getInstance("MD5").clone();
md.update(addform.getPassword().getBytes("UTF-8"));
byte[] pd = md.digest();
StringBuffe... | true |
900,381 | 15,683,090 | 4,961,134 | private void doUpload(UploadKind uploadKind, WriteKind writeKind) throws Exception {
int n = 512 * 1024;
AtomicInteger total = new AtomicInteger(0);
ServerSocket ss = startSinkServer(total);
URL url = new URL("http://localhost:" + ss.getLocalPort() + "/test1");
HttpURLConnect... | private void alterarArtista(Artista artista) throws Exception {
Connection conn = null;
PreparedStatement ps = null;
try {
conn = C3P0Pool.getConnection();
String sql = "UPDATE artista SET nome = ?,sexo = ?,email = ?,obs = ?,telefone = ? where numeroinscricao = ?";
... | false |
900,382 | 14,050,307 | 489,386 | public int instantiate(int objectId, String description) throws FidoDatabaseException, ObjectNotFoundException, ClassLinkTypeNotFoundException {
try {
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
try {
String sql = "inser... | 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.write... | false |
900,383 | 6,037,295 | 204,078 | public void copyContent(long mailId1, long mailId2) throws Exception {
File file1 = new File(this.getMailDir(mailId1) + "/");
File file2 = new File(this.getMailDir(mailId2) + "/");
this.recursiveDir(file2);
if (file1.isDirectory()) {
File[] files = file1.listFiles();
... | 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 = p... | true |
900,384 | 20,019,830 | 18,924,485 | public static void fileCopy(File sourceFile, File destFile) throws IOException {
FileChannel source = null;
FileChannel destination = null;
FileInputStream fis = null;
FileOutputStream fos = null;
try {
fis = new FileInputStream(sourceFile);
fos = new ... | public void processExplicitSchemaAndWSDL(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
HashMap services = configContext.getAxisConfiguration().getServices();
String filePart = req.getRequestURL().toString();
String schema = filePart.substring(filePar... | true |
900,385 | 20,587,078 | 2,238,217 | public static void main(String[] a) {
ArrayList<String> allFilesToBeCopied = new ArrayList<String>();
new File(outputDir).mkdirs();
try {
FileReader fis = new FileReader(completeFileWithDirToCathFileList);
BufferedReader bis = new BufferedReader(fis);
Stri... | public void includeJs(Group group, Writer out, PageContext pageContext) throws IOException {
includeResource(pageContext, out, RetentionHelper.buildRootRetentionFilePath(group, ".js"), JS_BEGIN_TAG, JS_END_TAG);
ByteArrayOutputStream outtmp = new ByteArrayOutputStream();
if (AbstractGroupBui... | true |
900,386 | 15,767,021 | 21,266,147 | private void documentFileChooserActionPerformed(java.awt.event.ActionEvent evt) {
if (evt.getActionCommand().equals(JFileChooser.APPROVE_SELECTION)) {
File selectedFile = documentFileChooser.getSelectedFile();
File collectionCopyFile;
String newDocumentName = selectedFile... | public void execute() {
File sourceFile = new File(oarfilePath);
File destinationFile = new File(deploymentDirectory + File.separator + sourceFile.getName());
try {
FileInputStream fis = new FileInputStream(sourceFile);
FileOutputStream fos = new FileOutputStream(dest... | true |
900,387 | 21,817,955 | 13,329,811 | public void movePrior(String[] showOrder, String[] orgID, String targetShowOrder, String targetOrgID) throws Exception {
Connection con = null;
PreparedStatement ps = null;
ResultSet result = null;
int moveCount = showOrder.length;
DBOperation dbo = factory.createDBOperation(... | @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=advan... | false |
900,388 | 11,279,071 | 343,230 | public static String getSHA1Digest(String inputStr) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = null;
byte[] sha1hash = null;
md = MessageDigest.getInstance("SHA");
sha1hash = new byte[40];
md.update(inputStr.getBytes("iso-8859-1"), 0, i... | public Source resolve(String href, String base) throws TransformerException {
if (href.endsWith(".txt")) {
try {
URL url = new URL(new URL(base), href);
java.io.InputStream in = url.openConnection().getInputStream();
java.io... | false |
900,389 | 4,471,001 | 19,809,975 | public static boolean decodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base64.... | public static String getETag(final String uri, final long lastModified) {
try {
final MessageDigest dg = MessageDigest.getInstance("MD5");
dg.update(uri.getBytes("utf-8"));
dg.update(new byte[] { (byte) ((lastModified >> 24) & 0xFF), (byte) ((lastModified >> 16) & 0xFF), ... | false |
900,390 | 7,954,779 | 15,826,300 | public void filter(File source, File destination, MNamespace mNamespace) throws Exception {
BufferedReader reader = new BufferedReader(new FileReader(source));
BufferedWriter writer = new BufferedWriter(new FileWriter(destination));
int line = 0;
int column = 0;
Stack parseSt... | public static Map<String, List<String>> getResponseHeader(String address) {
System.out.println(address);
URLConnection conn = null;
Map<String, List<String>> responseHeader = null;
try {
URL url = new URL(address);
conn = url.openConnection();
resp... | false |
900,391 | 22,998,998 | 17,014,842 | public static void copyFile(File sourceFile, File destFile) throws IOException {
FileChannel inputFileChannel = new FileInputStream(sourceFile).getChannel();
FileChannel outputFileChannel = new FileOutputStream(destFile).getChannel();
long offset = 0L;
long length = inputFileChannel.... | private String createDefaultRepoConf() throws IOException {
InputStream confIn = getClass().getResourceAsStream(REPO_CONF_PATH);
File tempConfFile = File.createTempFile("repository", "xml");
tempConfFile.deleteOnExit();
IOUtils.copy(confIn, new FileOutputStream(tempConfFile));
... | true |
900,392 | 12,800,568 | 13,576,759 | public void exportFile() {
String expfolder = PropertyHandler.getInstance().getProperty(PropertyHandler.KINDLE_EXPORT_FOLDER_KEY);
File out = new File(expfolder + File.separator + previewInfo.getTitle() + ".prc");
File f = new File(absPath);
try {
FileOutputStream fout = ... | 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("/")) ;
{
... | false |
900,393 | 10,467,996 | 13,227,684 | public void copyFile(String oldPath, String newPath) {
try {
int bytesum = 0;
int byteread = 0;
File oldfile = new File(oldPath);
if (oldfile.exists()) {
InputStream inStream = new FileInputStream(oldPath);
FileOutputStream fs =... | public static void main(String[] args) {
for (int i = 0; i < args.length - 2; i++) {
if (!CommonArguments.parseArguments(args, i, u)) {
u.usage();
System.exit(1);
}
if (CommonParameters.startArg > (i + 1)) i = CommonParameters.startArg - 1;... | true |
900,394 | 3,673,887 | 6,061,403 | public static final void copyFile(File source, File destination) throws IOException {
FileChannel sourceChannel = new FileInputStream(source).getChannel();
FileChannel targetChannel = new FileOutputStream(destination).getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), targetChan... | public static boolean decodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base64.... | true |
900,395 | 17,944,692 | 14,050,308 | @Override
public void run() {
try {
if (!Util.isSufficienDataForUpload(recordedGeoPoints)) return;
final InputStream gpxInputStream = new ByteArrayInputStream(RecordedRouteGPXFormatter.create(recordedGeoPoints).getBytes());
... | public void deleteInstance(int instanceId) throws FidoDatabaseException, ObjectNotFoundException {
try {
Connection conn = null;
Statement stmt = null;
try {
conn = fido.util.FidoDataSource.getConnection();
conn.setAutoCommit(false);
... | false |
900,396 | 587,124 | 18,583,832 | 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 = p... | private static void copy(File source, File target) throws IOException {
FileInputStream from = null;
FileOutputStream to = null;
try {
from = new FileInputStream(source);
to = new FileOutputStream(target);
byte[] buffer = new byte[4096];
int by... | true |
900,397 | 2,269,290 | 420,619 | public final void copyFile(final File fromFile, final File toFile) throws IOException {
this.createParentPathIfNeeded(toFile);
final FileChannel sourceChannel = new FileInputStream(fromFile).getChannel();
final FileChannel targetChannel = new FileOutputStream(toFile).getChannel();
fi... | 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 = p... | true |
900,398 | 20,784,790 | 6,288,460 | private static void copy(File source, File target) throws IOException {
FileInputStream in = new FileInputStream(source);
FileOutputStream out = new FileOutputStream(target);
byte[] buffer = new byte[4096];
int no = 0;
try {
while ((no = in.read(buffer)) != -1) ou... | private static void createNonCompoundData(String dir, String type) {
try {
Set s = new HashSet();
File nouns = new File(dir + "index." + type);
FileInputStream fis = new FileInputStream(nouns);
InputStreamReader reader = new InputStreamReader(fis);
... | true |
900,399 | 22,135,201 | 3,104,483 | public void testCodingFromFileSmaller() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
WritableByteChannel channel = newChannel(baos);
HttpParams params = new BasicHttpParams();
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, params);... | @Override
public void writeTo(final TrackRepresentation t, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws WebApplicationException {
if (mediaType.isCompatibl... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.