text string | label int64 |
|---|---|
[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 void doCompress(File[] files, File out, List<String> excludedKeys) {
Map<String, File> map = new HashMap<String, File>();
String parent = FilenameUtils.getBaseName(out.getName());
for (File f : files) {
CompressionUtil.list(f, parent, map, excludedKeys);
}
... | 1 |
[CLS] public static String[] parsePLS(String strURL, Context c) {
URL url;
URLConnection urlConn = null;
String TAG = "parsePLS";
Vector<String> radio = new Vector<String>();
final String filetoken = "file";
final String SPLITTER = "=";
try {
url = new... | 1 |
[CLS] protected void doBackupOrganizeType() throws Exception {
Connection con = null;
PreparedStatement ps = null;
ResultSet result = null;
String strSelQuery = "SELECT organize_type_id,organize_type_name,width " + "FROM " + Common.ORGANIZE_TYPE_TABLE;
String strInsQuery = "INSER... | 0 |
[CLS] public static StringBuffer getCachedFile(String url) throws Exception {
File urlCache = new File("tmp-cache/" + url.replace('/', '-'));
new File("tmp-cache/").mkdir();
if (urlCache.exists()) {
BufferedReader in = new BufferedReader(new FileReader(urlCache));
StringB... | 0 |
[CLS] public static void main(String args[]) {
String midletClass = null;
;
File appletInputFile = null;
File deviceInputFile = null;
File midletInputFile = null;
File htmlOutputFile = null;
File appletOutputFile = null;
File deviceOutputFile = null;
... | 1 |
[CLS] protected List<String[]> execute(String queryString, String sVar1, String sVar2, String filter) throws Exception {
String query = URLEncoder.encode(queryString, "UTF-8");
String urlString = "http://sparql.bibleontology.com/sparql.jsp?sparql=" + query + "&type1=xml";
URL url;
Buffer... | 0 |
[CLS] private static void addFileToZip(String path, String srcFile, ZipOutputStream zip, String prefix, String suffix) throws Exception {
File folder = new File(srcFile);
if (folder.isDirectory()) {
addFolderToZip(path, srcFile, zip, prefix, suffix);
} else {
if (isFileNa... | 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... | 1 |
[CLS] 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... | 0 |
[CLS] public void save(InputStream is) throws IOException {
File dest = Config.getDataFile(getInternalDate(), getPhysMessageID());
OutputStream os = null;
try {
os = new FileOutputStream(dest);
IOUtils.copyLarge(is, os);
} finally {
IOUtils.closeQuietl... | 1 |
[CLS] private void dumpFile(File repository, File copy) {
try {
if (copy.exists() && !copy.delete()) {
throw new RuntimeException("can't delete copy: " + copy);
}
printFile("Real Archive File", repository);
new ZipArchive(repository.getPath());
... | 0 |
[CLS] @Override
public void run() {
try {
if (LOG.isDebugEnabled()) {
LOG.debug("Backupthread started");
}
if (_file.exists()) {
_file.delete();
}
final ZipOutputStream zOut = new ZipOutputStream(new FileOutputStream... | 1 |
[CLS] public Web(String urlString, String charset) throws java.net.MalformedURLException, java.io.IOException {
this.charset = charset;
final java.net.URL url = new java.net.URL(urlString);
final java.net.URLConnection uconn = url.openConnection();
if (!(uconn instanceof java.net.HttpURL... | 0 |
[CLS] private byte[] download(String URL) {
byte[] result = null;
HttpEntity httpEntity = null;
try {
HttpGet httpGet = new HttpGet(URL);
httpGet.addHeader("Accept-Language", "zh-cn,zh,en");
httpGet.addHeader("Accept-Encoding", "gzip,deflate");
Htt... | 0 |
[CLS] public final String encrypt(String input) throws Exception {
try {
MessageDigest messageDigest = (MessageDigest) MessageDigest.getInstance(algorithm).clone();
messageDigest.reset();
messageDigest.update(input.getBytes());
String output = convert(messageDiges... | 0 |
[CLS] public static Collection<SearchKeyResult> searchKey(String iText, String iKeyServer) throws Exception {
Vector<SearchKeyResult> outVec = new Vector<SearchKeyResult>();
String uri = iKeyServer + "/pks/lookup?search=" + URLEncoder.encode(iText, "UTF-8");
URL url = new URL(uri);
Buffe... | 0 |
[CLS] protected Set<String> moduleNamesFromReader(URL url) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
Set<String> names = new HashSet<String>();
String line;
while ((line = reader.readLine()) != null) {
line = lin... | 0 |
[CLS] protected BufferedImage handleGMUException() {
if (params.uri.startsWith("http://mars.gmu.edu:8080")) try {
URLConnection connection = new URL(params.uri).openConnection();
int index = params.uri.lastIndexOf("?");
params.uri = "<img class=\"itemthumb\" src=\"";
... | 0 |
[CLS] public static String sendRequest(String urlstring) {
URL url;
String line;
Log.i("DVBMonitor", "Please wait while receiving data from dvb...");
try {
url = new URL(urlstring);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
... | 0 |
[CLS] @Override
public void actionPerformed(ActionEvent event) {
if (event.getSource() == btnChange) {
Error.log(7002, "Bot�o alterar pressionado por " + login + ".");
if (new String(passwordUser1.getPassword()).compareTo("") == 0) {
JOptionPane.sh... | 1 |
[CLS] private static void copyFile(String from, String to) throws IOException {
FileReader in = new FileReader(from);
FileWriter out = new FileWriter(to);
int c;
while ((c = in.read()) != -1) out.write(c);
in.close();
out.close();
} [SEP] private void gravaOp(Vector<?... | 0 |
[CLS] @Override
public void createCopy(File sourceFile, File destinnationFile) throws IOException {
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChannel();
destination = new FileOutputStream(destinnationF... | 1 |
[CLS] public BufferedWriter createOutputStream(String inFile, String outFile) throws IOException {
int k_blockSize = 1024;
int byteCount;
char[] buf = new char[k_blockSize];
File ofp = new File(outFile);
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(ofp));
... | 1 |
[CLS] public static void copyFile(File source, File dest) throws IOException {
if (source.equals(dest)) return;
FileChannel srcChannel = new FileInputStream(source).getChannel();
FileChannel dstChannel = new FileOutputStream(dest).getChannel();
dstChannel.transferFrom(srcChannel, 0, srcC... | 1 |
[CLS] public static byte[] hashFile(File file) {
long size = file.length();
long jump = (long) (size / (float) CHUNK_SIZE);
MessageDigest digest;
FileInputStream stream;
try {
stream = new FileInputStream(file);
digest = MessageDigest.getInstance("SHA-256"... | 0 |
[CLS] public static void extractFile(String jarArchive, String fileToExtract, String destination) {
FileWriter writer = null;
ZipInputStream zipStream = null;
try {
FileInputStream inputStream = new FileInputStream(jarArchive);
BufferedInputStream bufferedStream = new Buf... | 1 |
[CLS] public static String compute(String text) {
try {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[32];
md.update(text.getBytes("UTF-8"), 0, text.length());
md5hash = md.digest();
return convertToHex(... | 0 |
[CLS] private void copyFileToPhotoFolder(File photo, String personId) {
try {
FileChannel in = new FileInputStream(photo).getChannel();
File dirServer = new File(Constants.PHOTO_DIR);
if (!dirServer.exists()) {
dirServer.mkdirs();
}
Fil... | 1 |
[CLS] private void getPicture(String urlPath, String picId) throws Exception {
URL url = new URL(urlPath);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setConnectTimeout(10000);
if (conn.getResponseCode() == 200) {
... | 0 |
[CLS] protected boolean update(String sql, int requiredRows, int maxRows) throws SQLException {
if (LOG.isDebugEnabled()) {
LOG.debug("executing " + sql + "...");
}
Connection connection = null;
boolean oldAutoCommit = true;
try {
connection = dataSource.g... | 1 |
[CLS] public String encripta(String senha) {
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(senha.getBytes());
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(digest.digest());
} catch (NoSuchAlgorithmExcept... | 0 |
[CLS] private static String getDocumentAt(String urlString) {
StringBuffer html_text = new StringBuffer();
try {
URL url = new URL(urlString);
URLConnection conn = url.openConnection();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStre... | 1 |
[CLS] public static String hashSHA1(String value) {
try {
MessageDigest digest = MessageDigest.getInstance("SHA-1");
digest.update(value.getBytes());
BigInteger hash = new BigInteger(1, digest.digest());
return hash.toString(16);
} catch (NoSuchAlgorithmEx... | 0 |
[CLS] private void addConfigurationResource(final String fileName, final boolean ensureLoaded) {
try {
final ClassLoader cl = this.getClass().getClassLoader();
final Properties p = new Properties();
final URL url = cl.getResource(fileName);
if (url == null) {
... | 0 |
[CLS] 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_contentLe... | 0 |
[CLS] @Override
public int write(FileStatus.FileTrackingStatus fileStatus, InputStream input, PostWriteAction postWriteAction) throws WriterException, InterruptedException {
String key = logFileNameExtractor.getFileName(fileStatus);
int wasWritten = 0;
FileOutputStreamPool fileOutputStreamPo... | 1 |
[CLS] public void copyFile(String source_file_path, String destination_file_path) {
FileWriter fw = null;
FileReader fr = null;
BufferedReader br = null;
BufferedWriter bw = null;
File source = null;
try {
fr = new FileReader(source_file_path);
fw ... | 1 |
[CLS] public static String getSHADigest(String input) {
if (input == null) return null;
MessageDigest sha = null;
try {
sha = MessageDigest.getInstance("SHA-1");
} catch (java.security.NoSuchAlgorithmException nsae) {
throw new RuntimeException(nsae);
}
... | 1 |
[CLS] public void handleMessage(Message message) throws Fault {
InputStream is = message.getContent(InputStream.class);
if (is == null) {
return;
}
CachedOutputStream bos = new CachedOutputStream();
try {
IOUtils.copy(is, bos);
is.close();
... | 1 |
[CLS] public static void cpdir(File src, File dest) throws BrutException {
dest.mkdirs();
File[] files = src.listFiles();
for (int i = 0; i < files.length; i++) {
File file = files[i];
File destFile = new File(dest.getPath() + File.separatorChar + file.getName());
... | 1 |
[CLS] public static void copyFile(File src, File dst) throws IOException {
if (T.t) T.info("Copying " + src + " -> " + dst + "...");
FileInputStream in = new FileInputStream(src);
FileOutputStream out = new FileOutputStream(dst);
byte buf[] = new byte[40 * KB];
int read;
... | 1 |
[CLS] public static void copyFile(File source, File destination) {
if (!source.exists()) {
return;
}
if ((destination.getParentFile() != null) && (!destination.getParentFile().exists())) {
destination.getParentFile().mkdirs();
}
try {
FileChann... | 1 |
[CLS] @Override
public void run() {
long timeout = 10 * 1000L;
long start = (new Date()).getTime();
try {
InputStream is = socket.getInputStream();
boolean available = false;
while (!available && !socket.isClosed()) {
... | 1 |
[CLS] public boolean excuteBackup(String backupOrginlDrctry, String targetFileNm, String archiveFormat) throws JobExecutionException {
File targetFile = new File(targetFileNm);
File srcFile = new File(backupOrginlDrctry);
if (!srcFile.exists()) {
log.error("백업원본디렉토리[" + srcFile.getAb... | 1 |
[CLS] public static void main(String[] args) throws Exception {
InputStream in = null;
try {
in = new URL(args[0]).openStream();
IOUtils.copyBytes(in, System.out, 4096, false);
} finally {
IOUtils.closeStream(in);
}
} [SEP] @Override
public voi... | 1 |
[CLS] private void saveAttachment(long messageId, Part attachment, boolean saveAsNew) throws IOException, MessagingException {
long attachmentId = -1;
Uri contentUri = null;
int size = -1;
File tempAttachmentFile = null;
if ((!saveAsNew) && (attachment instanc... | 1 |
[CLS] public static void saveZipComponents(ZipComponents zipComponents, File zipFile) throws FileNotFoundException, IOException, Exception {
ZipOutputStream zipOutStream = new ZipOutputStream(new FileOutputStream(zipFile));
for (ZipComponent comp : zipComponents.getComponents()) {
ZipEntry n... | 1 |
[CLS] public static void copyTo(java.io.File source, java.io.File dest) throws Exception {
java.io.FileInputStream inputStream = null;
java.nio.channels.FileChannel sourceChannel = null;
java.io.FileOutputStream outputStream = null;
java.nio.channels.FileChannel destChannel = null;
... | 1 |
[CLS] 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... | 0 |
[CLS] public void createZip(File zipFileName, Vector<File> selected) {
try {
byte[] buffer = new byte[4096];
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(zipFileName), 8096));
out.setLevel(Deflater.BEST_COMPRESSION);
out.... | 1 |
[CLS] public static boolean copy(InputStream is, File file) {
try {
IOUtils.copy(is, new FileOutputStream(file));
return true;
} catch (Exception e) {
logger.severe(e.getMessage());
return false;
}
} [SEP] @TestTargetNew(level = TestLevel.COMPL... | 0 |
[CLS] private static HttpURLConnection getDefaultConnection(URL url) throws Exception {
HttpURLConnection httpConn = (HttpURLConnection) url.openConnection();
httpConn.setDoInput(true);
httpConn.setDoOutput(true);
httpConn.setUseCaches(false);
httpConn.setDefaultUseCaches(false);... | 0 |
[CLS] public static void copyFile(String fromFilePath, String toFilePath, boolean overwrite) throws IOException {
File fromFile = new File(fromFilePath);
File toFile = new File(toFilePath);
if (!fromFile.exists()) throw new IOException("FileCopy: " + "no such source file: " + fromFilePath);
... | 1 |
[CLS] public File download(Show s) throws Exception {
Collection<String> exclude = Util.toCollection((List<String>) this.exclude.clone(), Util.nonNullString(s.getExclude()).split(","));
URL url = new URL("http://v3.newzbin.com/search/" + buildQuery(s));
BufferedReader in = new BufferedReader(new... | 1 |
[CLS] private void checkResourceAvailable() throws XQException {
HttpUriRequest head = new HttpHead(remoteURL);
try {
HttpResponse response = httpClient.execute(head);
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) throw new XQException("Could not connect to th... | 0 |
[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... | 1 |
[CLS] public void reload() throws SAXException, IOException {
if (url != null) {
java.io.InputStream is = url.openStream();
configDoc = builder.parse(is);
is.close();
System.out.println("XML config file read correctly from " + url);
} else {
co... | 0 |
[CLS] static void copyFile(File file, File file1) throws IOException {
byte abyte0[] = new byte[512];
FileInputStream fileinputstream = new FileInputStream(file);
FileOutputStream fileoutputstream = new FileOutputStream(file1);
int i;
while ((i = fileinputstream.read(abyte0)) > 0... | 1 |
[CLS] public static void registerProviders(ResteasyProviderFactory factory) throws Exception {
Enumeration<URL> en = Thread.currentThread().getContextClassLoader().getResources("META-INF/services/" + Providers.class.getName());
LinkedHashSet<String> set = new LinkedHashSet<String>();
while (en.h... | 0 |
[CLS] private void parseXMLFile() {
String u = WeatherApplication.SERVER + location + ".xml";
InputStream in = null;
String str = null;
try {
URL url = new URL(u);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
in = url.openStream();... | 0 |
[CLS] public void prepareWorkingDirectory() throws Exception {
workingDirectory = tempDir + "/profile_" + System.nanoTime();
(new File(workingDirectory)).mkdir();
String monitorCallShellScript = "data/scripts/monitorcall.sh";
URL monitorCallShellScriptUrl = Thread.currentThread().getCont... | 1 |
[CLS] private void setInlineXML(Entry entry, DatastreamXMLMetadata ds) throws UnsupportedEncodingException, StreamIOException {
String content;
if (m_obj.hasContentModel(Models.SERVICE_DEPLOYMENT_3_0) && (ds.DatastreamID.equals("SERVICE-PROFILE") || ds.DatastreamID.equals("WSDL"))) {
content... | 1 |
[CLS] private void generateGuid() throws NoSuchAlgorithmException {
MessageDigest md5 = MessageDigest.getInstance("MD5");
StringBuilder stringToDigest = new StringBuilder();
long time = System.currentTimeMillis();
long rand = random.nextLong();
stringToDigest.append(time);
... | 1 |
[CLS] public static void executa(String arquivo, String filial, String ip) {
String drive = arquivo.substring(0, 2);
if (drive.indexOf(":") == -1) drive = "";
Properties p = Util.lerPropriedades(arquivo);
String servidor = p.getProperty("servidor");
String impressora = p.getPrope... | 1 |
[CLS] @Deprecated
public boolean backupLuceneIndex(int indexLocation, int backupLocation) {
boolean result = false;
try {
System.out.println("lucene backup started");
String indexPath = this.getIndexFolderPath(indexLocation);
String backupPath = this.getIndexFolde... | 1 |
[CLS] public RobotList<Percentage> sort_incr_Percentage(RobotList<Percentage> list, String field) {
int length = list.size();
Index_value[] distri = new Index_value[length];
for (int i = 0; i < length; i++) {
distri[i] = new Index_value(i, list.get(i).percent);
}
bool... | 0 |
End of preview. Expand in Data Studio
No dataset card yet
- Downloads last month
- 23