text string | label int64 |
|---|---|
[CLS] public List<SuspectFileProcessingStatus> retrieve() throws Exception {
BufferedOutputStream bos = null;
try {
String listFilePath = GeneralUtils.generateAbsolutePath(getDownloadDirectoryPath(), getListName(), "/");
listFilePath = listFilePath.concat(".xml");
if ... | 1 |
[CLS] @SuppressWarnings("null")
public static void copyFile(File src, File dst) throws IOException {
if (!dst.getParentFile().exists()) {
dst.getParentFile().mkdirs();
}
dst.createNewFile();
FileChannel srcC = null;
FileChannel dstC = null;
try {
... | 1 |
[CLS] private List<String> getRobots(String beginURL, String contextRoot) {
List<String> vtRobots = new ArrayList<String>();
BufferedReader bfReader = null;
try {
URL urlx = new URL(beginURL + "/" + contextRoot + "/" + "robots.txt");
URLConnection urlConn = urlx.openConne... | 0 |
[CLS] public static boolean copyFile(File src, File target) throws IOException {
if (src == null || target == null || !src.exists()) return false;
if (!target.exists()) if (!createNewFile(target)) return false;
InputStream ins = new BufferedInputStream(new FileInputStream(src));
OutputSt... | 1 |
[CLS] @Override
public void run() {
URL url = null;
FileOutputStream fos = null;
FTPClient ftp = null;
try {
url = new URL(super.getAddress());
String host = url.getHost();
String folder = StringUtils.substringBeforeLast(url.getPath(), "/");
... | 0 |
[CLS] public long copyDirAllFilesToDirectoryRecursive(String baseDirStr, String destDirStr, boolean copyOutputsRtIDsDirs) throws Exception {
long plussQuotaSize = 0;
if (baseDirStr.endsWith(sep)) {
baseDirStr = baseDirStr.substring(0, baseDirStr.length() - 1);
}
if (destDirSt... | 1 |
[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 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 void main(String[] args) {
File container = new File(ArchiveFeature.class.getProtectionDomain().getCodeSource().getLocation().toURI());
if (container == null) {
throw new RuntimeException("this use-case isn't being invoked from the executable jar");
}
JarF... | 0 |
[CLS] public static final void copyFile(File source, File target) {
try {
FileChannel srcChannel = new FileInputStream(source).getChannel();
FileChannel dstChannel = new FileOutputStream(target).getChannel();
dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
... | 1 |
[CLS] public void actionPerformed(ActionEvent e) {
if (path.compareTo("") != 0) {
imageName = (path.substring(path.lastIndexOf(File.separator) + 1, path.length()));
String name = imageName.substring(0, imageName.lastIndexOf('.'));
String extension = imageName.substring(imageN... | 1 |
[CLS] public RobotList<Percentage> sort_decr_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 |
[CLS] @RequestMapping(value = "/privatefiles/{file_name}")
public void getFile(@PathVariable("file_name") String fileName, HttpServletResponse response, Principal principal) {
try {
Boolean validUser = false;
final String currentUser = principal.getName();
Authentication ... | 1 |
[CLS] public static String md5(String input) {
byte[] temp;
try {
MessageDigest messageDigest;
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(input.getBytes());
temp = messageDigest.digest();
} catch (Exception e) {
... | 1 |
[CLS] public String gerarHash(String frase) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-256");
md.update(frase.getBytes());
byte[] bytes = md.digest();
StringBuilder s = new StringBuilder(0);
for (int i = 0; i < bytes.length; i++) {
... | 0 |
[CLS] public void test() throws Exception {
StringDocument doc = new StringDocument("Test", "UTF-8");
doc.open();
try {
assertEquals("UTF-8", doc.getCharacterEncoding());
assertEquals("Test", doc.getText());
InputStream input = doc.getInputStream();
... | 0 |
[CLS] public void update(String target, String cfgVersion) throws MalformedURLException, FileNotFoundException, IOException {
Debug.log("Config Updater", "Checking for newer configuration...");
URL url = new URL(target);
String[] urlSplit = target.split("/");
this.fileName = urlSplit[url... | 0 |
[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();
... | 0 |
[CLS] public void transferOutputFiles() throws IOException {
HashSet<GridNode> nodes = (HashSet) batchTask.returnNodeCollection();
Iterator<GridNode> ic = nodes.iterator();
InetAddress addLocal = InetAddress.getLocalHost();
String hostnameLocal = addLocal.getHostName();
while (ic... | 0 |
[CLS] public void writeTo(OutputStream out) throws IOException, MessagingException {
InputStream in = getInputStream();
Base64OutputStream base64Out = new Base64OutputStream(out);
IOUtils.copy(in, base64Out);
base64Out.close();
mFile.delete();
} [SEP] public void gzip(File fr... | 1 |
[CLS] public static void invokeMvnArtifact(final IProject project, final IModuleExtension moduleExtension, final String location) throws CoreException, InterruptedException, IOException {
final Properties properties = new Properties();
properties.put("archetypeGroupId", "org.nexopenframework.plugins");
... | 1 |
[CLS] private BundleURLClassPath createBundleURLClassPath(Bundle bundle, Version version, File bundleFile, File cache, boolean alreadyCached) throws Exception {
String bundleClassPath = (String) bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
if (bundleClassPath == null) {
bundleClassPa... | 0 |
[CLS] 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[0x100... | 1 |
[CLS] private static final String getResult(String url, String postData) throws MalformedURLException, IOException {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
if (!postData.equals("null")) {
postData = postData.substring(1, postData.length() - 1);
... | 0 |
[CLS] public static void doVersionCheck(View view) {
view.showWaitCursor();
try {
URL url = new URL(jEdit.getProperty("version-check.url"));
InputStream in = url.openStream();
BufferedReader bin = new BufferedReader(new InputStreamReader(in));
String line;... | 1 |
[CLS] protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
final FileManager fmanager = FileManager.getFileManager(request, leechget);
ServletFileUpload upload = new ServletFileUpload();
FileItemIterator iter;
try {
... | 1 |
[CLS] public static void doVersionCheck(View view) {
view.showWaitCursor();
try {
URL url = new URL(jEdit.getProperty("version-check.url"));
InputStream in = url.openStream();
BufferedReader bin = new BufferedReader(new InputStreamReader(in));
String line;... | 1 |
[CLS] public Component loadComponent(URI uri, URI origuri) throws ComponentException {
if (usePrivMan) PrivilegeManager.enablePrivilege("UniversalConnect");
ConzillaRDFModel model = factory.createModel(origuri, uri);
RDFParser parser = new com.hp.hpl.jena.rdf.arp.StanfordImpl();
java.net... | 0 |
[CLS] @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
String requestURI = req.getRequestURI();
logger.info("The requested URI: {}", requestURI);
String parameter = requestURI.substring(requestURI.lastIndexOf(ARXIVID_ENTRY) + ARXIVID_... | 0 |
[CLS] public static void main(String[] args) {
try {
String user = "techbeherca";
String targetUrl = "http://api.fanfou.com/statuses/user_timeline.xml?id=" + user;
URL url = new URL(targetUrl);
InputStream in = url.openStream();
ArrayList<MessageObj> l... | 0 |
[CLS] public String postEvent(EventDocument eventDoc, Map attachments) {
if (eventDoc == null || eventDoc.getEvent() == null) return null;
if (queue == null) {
sendEvent(eventDoc, attachments);
return eventDoc.getEvent().getEventId();
}
if (attachments != null) {
... | 1 |
[CLS] 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)), Base6... | 1 |
[CLS] protected static String getURLandWriteToDisk(String url, Model retModel) throws MalformedURLException, IOException {
String path = null;
URL ontURL = new URL(url);
InputStream ins = ontURL.openStream();
InputStreamReader bufRead;
OutputStreamWriter bufWrite;
int off... | 1 |
[CLS] private void updateViewerContent(ScrollingGraphicalViewer viewer) {
BioPAXGraph graph = (BioPAXGraph) viewer.getContents().getModel();
if (!graph.isMechanistic()) return;
Map<String, Color> highlightMap = new HashMap<String, Color>();
for (Object o : graph.getNodes()) {
... | 0 |
[CLS] public void run() {
try {
URL url = new URL("http://www.sourceforge.net/projects/beobachter/files/beobachter_version.html");
InputStreamReader reader = new InputStreamReader(url.openStream());
BufferedReader buffer = new BufferedReader(reader);
String versio... | 0 |
[CLS] public static String md5(String input) {
String res = "";
try {
MessageDigest algorithm = MessageDigest.getInstance("MD5");
algorithm.reset();
algorithm.update(input.getBytes());
byte[] md5 = algorithm.digest();
String tmp = "";
... | 0 |
[CLS] @Override
public void run() {
while (true) {
StringBuilder buffer = new StringBuilder(128);
buffer.append("insert into DOMAIN ( ").append(LS);
buffer.append(" DOMAIN_ID, TOP_DOMAI... | 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... | 0 |
[CLS] @Override
public void execute() throws BuildException {
if (this.toFile == null && this.toDir == null) throw new BuildException("Missing Destination File/Dir");
if (this.toFile != null && this.toDir != null) throw new BuildException("Both Defined Destination File/Dir");
if (this.urlStr... | 0 |
[CLS] private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
logger.debug("Random GUID error: " + e.getMessage(... | 1 |
[CLS] final void saveProject(Project project, final File file) {
if (projectsList.contains(project)) {
if (project.isDirty() || !file.getParentFile().equals(workspaceDirectory)) {
try {
if (!file.exists()) {
if (!file.createNewFile()) throw... | 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] 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 void copy(File source, File destination) {
try {
FileInputStream fileInputStream = new FileInputStream(source);
FileOutputStream fileOutputStream = new FileOutputStream(destination);
FileChannel inputChannel = fileInputStream.getChannel();
File... | 1 |
[CLS] public void copy(final File source, final File dest) throws IOException {
final FileInputStream in = new FileInputStream(source);
try {
final FileOutputStream out = new FileOutputStream(dest);
try {
final FileChannel inChannel = in.getChannel();
... | 0 |
[CLS] public void testGetRequestWithRefresh() throws Exception {
expect(request.getParameter(ProxyBase.REFRESH_PARAM)).andReturn("120").anyTimes();
Capture<HttpRequest> requestCapture = new Capture<HttpRequest>();
expect(pipeline.execute(capture(requestCapture))).andReturn(new HttpResponse(RESPO... | 0 |
[CLS] public static boolean copy(File source, File target) {
try {
if (!source.exists()) return false;
target.getParentFile().mkdirs();
InputStream input = new FileInputStream(source);
OutputStream output = new FileOutputStream(target);
byte[] buf = ne... | 1 |
[CLS] protected void downgradeHistory(Collection<String> versions) {
Assert.notEmpty(versions);
try {
Connection connection = this.database.getDefaultConnection();
PreparedStatement statement = connection.prepareStatement("UPDATE " + this.logTableName + " SET RESULT = 'DOWNGRADED... | 0 |
[CLS] static void invalidSlave(String msg, Socket sock) throws IOException {
BufferedReader _sinp = null;
PrintWriter _sout = null;
try {
_sout = new PrintWriter(sock.getOutputStream(), true);
_sinp = new BufferedReader(new InputStreamReader(sock.getInputStream()));
... | 1 |
[CLS] public static String CreateHash(String s) {
String str = s.toString();
if (str == null || str.length() == 0) {
throw new IllegalArgumentException("String cannot be null or empty");
}
StringBuffer hexString = new StringBuffer();
try {
MessageDigest md... | 1 |
[CLS] public void setTableBraille(String tableBraille, boolean sys) {
fiConf.setProperty(OptNames.fi_braille_table, tableBraille);
fiConf.setProperty(OptNames.fi_is_sys_braille_table, Boolean.toString(sys));
FileChannel in = null;
FileChannel out = null;
try {
String ... | 1 |
[CLS] public static int deleteHedgeCustTrade() {
Connection conn = null;
PreparedStatement psmt = null;
StringBuffer SQL = new StringBuffer(200);
int deleted = 0;
SQL.append(" DELETE FROM JHF_HEDGE_CUSTTRADE ");
try {
conn = JdbcConnectionPool.mainConnection()... | 0 |
[CLS] public static void main(String[] args) throws Exception {
FileChannel fc = new FileOutputStream("data.txt").getChannel();
fc.write(ByteBuffer.wrap("Some text ".getBytes()));
fc.close();
fc = new RandomAccessFile("data.txt", "rw").getChannel();
fc.position(fc.size());
... | 1 |
[CLS] public void readMESHDescriptorFileIntoFiles(String outfiledir) {
String inputLine, ins;
String filename = getMESHdescriptorfilename();
String uid = "";
String name = "";
String description = "";
String element_of = "";
Vector treenr = new Vector();
V... | 1 |
[CLS] public void SetRoles(Connection conn, User user, String[] roles) throws NpsException {
if (!IsSysAdmin() && !IsLocalAdmin()) throw new NpsException(ErrorHelper.ACCESS_NOPRIVILEGE);
PreparedStatement pstmt = null;
ResultSet rs = null;
try {
String sql = "delete from user... | 0 |
[CLS] private void doUpdate(final boolean notifyOnChange) {
if (!validServerUrl) {
return;
}
boolean tempBuildClean = true;
List failedBuilds = new ArrayList();
try {
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
... | 0 |
[CLS] String getLatestVersion() {
try {
URL url = new URL(Constants.VERSION_FILE_URL);
URLConnection connection = url.openConnection();
connection.setConnectTimeout(15000);
InputStream in = connection.getInputStream();
BufferedReader br = new BufferedR... | 0 |
[CLS] public static boolean copyFileToDir(File inputFile, File outputDir) {
try {
String outputFileName = inputFile.getName();
int index = 1;
while (existFileInDir(outputFileName, outputDir)) {
outputFileName = index + inputFile.getName();
inde... | 1 |
[CLS] private byte[] hash(String data, HashAlg alg) {
try {
MessageDigest digest = MessageDigest.getInstance(alg.toString());
digest.update(data.getBytes());
byte[] hash = digest.digest();
return hash;
} catch (NoSuchAlgorithmException e) {
}
... | 0 |
[CLS] protected boolean checkLogin(String username, String password) {
log.debug("Called checkLogin with " + username);
String urlIn = GeoNetworkContext.url + "/" + GeoNetworkContext.loginService + "?username=" + username + "&password=" + password;
Element results = null;
String cookieVa... | 0 |
[CLS] public void downloadClicked() {
String s_url;
try {
double minlat = Double.parseDouble(minLat.text());
double maxlat = Double.parseDouble(maxLat.text());
double minlong = Double.parseDouble(minLong.text());
double maxlong = Double.parseDouble(maxLong... | 0 |
[CLS] public void createResource(String resourceUri, boolean publish, User user) throws IOException {
PermissionAPI perAPI = APILocator.getPermissionAPI();
Logger.debug(this.getClass(), "createResource");
resourceUri = stripMapping(resourceUri);
String hostName = getHostname(resourceUri)... | 1 |
[CLS] 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);
... | 1 |
[CLS] private void executeScript(SQLiteDatabase sqlDatabase, InputStream input) {
StringWriter writer = new StringWriter();
try {
IOUtils.copy(input, writer);
} catch (IOException e) {
throw new ComixException("Could not read the database script", e);
}
St... | 1 |
[CLS] public Object next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
this.currentGafFilePath = this.url;
try {
if (this.httpURL != null) {
LOG.info("Reading URL :" + httpURL);
InputStream is = this.httpURL.openStream... | 1 |
[CLS] public synchronized String encrypt(String plaintext) throws ServiceRuntimeException {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
throw new ServiceRuntimeException(e.getMessage());
}
tr... | 0 |
[CLS] public static boolean copy(File source, File target, boolean owrite) {
if (!source.exists()) {
log.error("Invalid input to copy: source " + source + "doesn't exist");
return false;
} else if (!source.isFile()) {
log.error("Invalid input to copy: source " + sourc... | 1 |
[CLS] public void testDecode1000BinaryStore() throws Exception {
EXISchema corpus = EXISchemaFactoryTestUtil.getEXISchema("/DataStore/DataStore.xsd", getClass(), m_compilerErrors);
Assert.assertEquals(0, m_compilerErrors.getTotalCount());
GrammarCache grammarCache = new GrammarCache(corpus, Gram... | 0 |
[CLS] @Override
public void exec() {
if (fileURI == null) return;
InputStream is = null;
try {
if (fileURI.toLowerCase().startsWith("dbgp://")) {
String uri = fileURI.substring(7);
if (uri.toLowerCase().startsWith("file/")) {
ur... | 0 |
[CLS] private void publishZip(LWMap map) {
try {
if (map.getFile() == null) {
VueUtil.alert(VueResources.getString("dialog.mapsave.message"), VueResources.getString("dialog.mapsave.title"));
return;
}
File savedCMap = PublishUtil.createZip(map,... | 0 |
[CLS] public static String Md5By32(String plainText) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(plainText.getBytes());
byte b[] = md.digest();
int i;
StringBuffer buf = new StringBuffer("");
for (int offset = 0; ... | 1 |
[CLS] public static void main(String[] args) {
URL url = null;
EventHeap eh = new EventHeap("iw-room2");
Event newEvent;
float chan1 = -1, chan2 = -1;
try {
url = new URL("http://iw--bluetooth-ap/cgi-bin/sens.cgi");
} catch (MalformedURLException e) {
... | 0 |
[CLS] public static void doVersionCheck(View view) {
view.showWaitCursor();
try {
URL url = new URL(jEdit.getProperty("version-check.url"));
InputStream in = url.openStream();
BufferedReader bin = new BufferedReader(new InputStreamReader(in));
String line;... | 0 |
[CLS] public void testCopyFolderContents() throws IOException {
log.info("Running: testCopyFolderContents()");
IOUtils.copyFolderContents(srcFolderName, destFolderName);
Assert.assertTrue(destFile1.exists() && destFile1.isFile());
Assert.assertTrue(destFile2.exists() && destFile2.isFile(... | 0 |
[CLS] public void bindDownload(Download download) throws BindingException {
List<ChunkDownload> chunks = download.getChunks();
File destination = download.getFile();
FileOutputStream fos = null;
try {
fos = FileUtils.openOutputStream(destination);
for (ChunkDownlo... | 0 |
[CLS] public ISOMsg filter(ISOChannel channel, ISOMsg m, LogEvent evt) throws VetoException {
if (key == null || fields == null) throw new VetoException("MD5Filter not configured");
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(getKey());
int[] ... | 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 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();
... | 1 |
[CLS] public RemotePolicyMigrator createRemotePolicyMigrator() {
return new RemotePolicyMigrator() {
public String migratePolicy(InputStream stream, String url) throws ResourceMigrationException, IOException {
ByteArrayOutputCreator oc = new ByteArrayOutputCreator();
... | 1 |
[CLS] public HttpResponse executeWithoutRewriting(HttpUriRequest request, HttpContext context) throws IOException {
int code = -1;
long start = SystemClock.elapsedRealtime();
try {
HttpResponse response;
mConnectionAllocated.set(null);
if (NetworkStatsEntity.s... | 0 |
[CLS] public static List<Item> doService(List<String> itemIds, Boolean archive) throws UnsupportedEncodingException, IOException {
DefaultHttpClient httpclient = new DefaultHttpClient();
ToggleArchiveRequest request = new ToggleArchiveRequest();
String sessionId = (String) RuntimeAccess.getInsta... | 0 |
[CLS] 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... | 0 |
[CLS] public static String sendGetRequest(String endpoint, String requestParameters) {
if (endpoint == null) return null;
String result = null;
if (endpoint.startsWith("http://")) {
try {
StringBuffer data = new StringBuffer();
String urlStr = endpoint... | 0 |
[CLS] static String getMD5Hash(String str) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
byte[] b = md.digest();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < b.length; i++) {
int v = (int... | 1 |
[CLS] public String readTemplateToString(String fileName) {
URL url = null;
url = classLoader.getResource(fileName);
StringBuffer content = new StringBuffer();
if (url == null) {
String error = "Template file could not be found: " + fileName;
throw new RuntimeExce... | 1 |
[CLS] public static boolean copyFile(File source, File dest) throws IOException {
int answer = JOptionPane.YES_OPTION;
if (dest.exists()) {
answer = JOptionPane.showConfirmDialog(null, "File " + dest.getAbsolutePath() + "\n already exists. Overwrite?", "Warning", JOptionPane.YES_NO_OPTION);... | 1 |
[CLS] public void initURL(URL url, boolean cache) throws IOException {
this.url = url;
if (cache) {
System.out.println(getClass().getName() + ": caching '" + url + "'");
InputStream urlIS = new BufferedInputStream(url.openStream(), 1024 * 30);
file = File.createTempFi... | 0 |
[CLS] public boolean onStart() {
log("Starting up, this may take a minute...");
gui = new ApeAtollGUI();
gui.setVisible(true);
while (waitGUI) {
sleep(100);
}
URLConnection url = null;
BufferedReader in = null;
BufferedWriter out = null;
... | 0 |
[CLS] public Logging() throws Exception {
File home = new File(System.getProperty("user.home"), ".jorgan");
if (!home.exists()) {
home.mkdirs();
}
File logging = new File(home, "logging.properties");
if (!logging.exists()) {
InputStream input = getClass().... | 1 |
[CLS] public static void doHttpPost(String urlName, byte[] data, String contentType, String cookieData) throws InteropException {
URL url = getAccessURL(urlName);
try {
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoOutput(true);
... | 0 |
[CLS] private boolean copy_to_file_io(File src, File dst) throws IOException {
InputStream is = null;
OutputStream os = null;
try {
is = new FileInputStream(src);
is = new BufferedInputStream(is);
os = new FileOutputStream(dst);
os = new BufferedOu... | 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 java.io.ByteArrayOutputStream getFileByteStream(URL _url) {
java.io.ByteArrayOutputStream buffer = new java.io.ByteArrayOutputStream();
try {
InputStream input = _url.openStream();
IOUtils.copy(input, buffer);
IOUtils.closeQuietly(input);
}... | 1 |
[CLS] protected EntailmentType invokeHttp(String stuff) {
String data = encode("theory") + "=" + encode(stuff);
URL url;
EntailmentType result = EntailmentType.unkown;
try {
url = new URL(httpAddress);
} catch (MalformedURLException e) {
throw new RuntimeE... | 0 |
[CLS] public static String sha1(String clearText, String seed) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update((seed + clearText).getBytes());
return convertToHex(md.digest());
} catch (Exception e) {
throw new RuntimeException(e.g... | 1 |
[CLS] @SuppressWarnings("unchecked")
public void handle(Map<String, Object> data, String urlPath) {
try {
URL url = new URL(urlPath);
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), "utf-8"));
String line = null;
CMGroup curr... | 0 |
[CLS] public void copyFilesIntoProject(HashMap<String, String> files) {
Set<String> filenames = files.keySet();
for (String key : filenames) {
String realPath = files.get(key);
if (key.equals("fw4ex.xml")) {
try {
FileReader in = new FileReader... | 1 |
[CLS] private void enumeratePathArchive(final String archive) throws IOException {
final boolean trace1 = m_trace1;
final File fullArchive = new File(m_currentPathDir, archive);
JarInputStream in = null;
try {
in = new JarInputStream(ne... | 0 |
[CLS] 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 = ne... | 1 |
[CLS] private String getMAC(String password) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
}
try {
md.update(password.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.