text string | label int64 |
|---|---|
[CLS] public static void copy(final File src, final File dst) throws IOException, IllegalArgumentException {
long fileSize = src.length();
final FileInputStream fis = new FileInputStream(src);
final FileOutputStream fos = new FileOutputStream(dst);
final FileChannel in = fis.getChannel()... | 1 |
[CLS] private InputStream callService(String text) {
InputStream in = null;
try {
URL url = new URL(SERVLET_URL);
URLConnection conn = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) conn;
httpConn.setRequestMethod("POST");
... | 0 |
[CLS] public ForkJavaProject(String projectName, Class<?> activatorClass) {
this.activatorClass = activatorClass;
try {
IWorkspaceRoot rootWorkspace = ResourcesPlugin.getWorkspace().getRoot();
this.prj = rootWorkspace.getProject(projectName);
if (this.prj.exists()) {
... | 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 int numberofLines(JApplet ja, String filename) {
int count = 0;
URL url = null;
String FileToRead;
FileToRead = "data/" + filename + ".csv";
try {
url = new URL(ja.getCodeBase(), FileToRead);
} catch (MalformedURLException e) {
... | 0 |
[CLS] public void testCreate() throws Exception {
File f = File.createTempFile("DiskCacheItemTest", "tmp");
f.deleteOnExit();
try {
DiskCacheItem i = new DiskCacheItem(f);
i.setLastModified(200005L);
i.setTranslationCount(11);
i.setEncoding("GB2312... | 1 |
[CLS] private void writeMessage(ChannelBuffer buffer, File dst) throws IOException {
ChannelBufferInputStream is = new ChannelBufferInputStream(buffer);
OutputStream os = null;
try {
os = new FileOutputStream(dst);
IOUtils.copyLarge(is, os);
} finally {
... | 1 |
[CLS] public static String md5String(String string) {
try {
MessageDigest msgDigest = MessageDigest.getInstance("MD5");
msgDigest.update(string.getBytes("UTF-8"));
byte[] digest = msgDigest.digest();
String result = "";
for (int i = 0; i < digest.lengt... | 0 |
[CLS] private static String md5(String digest, String data) throws IOException {
MessageDigest messagedigest;
try {
messagedigest = MessageDigest.getInstance(digest);
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
messagedigest.upd... | 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()));
... | 0 |
[CLS] 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);
}
... | 1 |
[CLS] @SuppressWarnings("unchecked")
public static void createInstance(ExternProtoDeclare externProtoDeclare) {
ExternProtoDeclareImport epdi = new ExternProtoDeclareImport();
HashMap<String, ProtoDeclareImport> protoMap = X3DImport.getTheImport().getCurrentParser().getProtoMap();
boolean lo... | 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] private static void readIzvestiyaArticles() throws IOException {
CsvReader reader = new CsvReader(new InputStreamReader(IzvestiyaUtil.class.getClassLoader().getResourceAsStream("mathnet_izvestiya.csv")), ';');
reader.setTrimWhitespace(true);
try {
while (reader.readRecord()) {
... | 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 ... | 0 |
[CLS] private final void saveCopy(String source, String destination) {
BufferedInputStream from = null;
BufferedOutputStream to = null;
try {
from = new BufferedInputStream(new FileInputStream(source));
to = new BufferedOutputStream(new FileOutputStream(destination));
... | 0 |
[CLS] public boolean setSchedule(Schedule s) {
PreparedStatement pst1 = null;
PreparedStatement pst2 = null;
PreparedStatement pst3 = null;
ResultSet rs2 = null;
boolean retVal = true;
try {
conn = getConnection();
pst1 = conn.prepareStatement("INS... | 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] private static String getSummaryText(File packageFile) {
String retVal = null;
Reader in = null;
try {
in = new FileReader(packageFile);
StringWriter out = new StringWriter();
IOUtils.copy(in, out);
StringBuffer buf = out.getBuffer();
... | 1 |
[CLS] public void sortPlayersTurn() {
Token tempT = new Token();
Player tempP = new Player("test name", tempT);
int tempN = 0;
boolean exchangeMade = true;
for (int i = 0; i < playerNum - 1 && exchangeMade; i++) {
exchangeMade = false;
for (int j = 0; j < ... | 0 |
[CLS] public static String MD5Encode(String password) {
MessageDigest messageDigest;
try {
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(password.getBytes());
final byte[] digest = messageDigest.digest();
final StringBuilder buf = ... | 0 |
[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... | 0 |
[CLS] public static final long copyFile(final File srcFile, final File dstFile, final long cpySize) throws IOException {
if ((null == srcFile) || (null == dstFile)) return (-1L);
final File dstFolder = dstFile.getParentFile();
if ((!dstFolder.exists()) && (!dstFolder.mkdirs())) throw new IOExcep... | 1 |
[CLS] public void actualizar() throws SQLException, ClassNotFoundException, Exception {
Connection conn = null;
PreparedStatement ms = null;
if (!validado) {
validado = validar();
}
if (!validado) {
throw new Exception("No s'ha realitzat la validació de le... | 0 |
[CLS] private void copyFile(File dir, File fileToAdd) {
try {
byte[] readBuffer = new byte[1024];
File file = new File(dir.getCanonicalPath() + File.separatorChar + fileToAdd.getName());
if (file.createNewFile()) {
FileInputStream fis = new FileInputStream(fil... | 1 |
[CLS] private static void copy(String sourceName, String destName) throws IOException {
File source = new File(sourceName);
File dest = new File(destName);
FileChannel in = null, out = null;
try {
in = new FileInputStream(source).getChannel();
out = new FileOutput... | 0 |
[CLS] public static InputStream obterConteudoArquivo(String u) {
URL url;
try {
url = new URL(u);
URLConnection conn = null;
if (proxy != null) conn = url.openConnection(proxy.getProxy()); else conn = url.openConnection();
return new DataInputStream(conn.g... | 0 |
[CLS] public static void downloadXrefTask(String url, String file) {
int n, progressi, progressn;
if (debug) System.err.println("Downloading " + url + " into " + file);
Progress progress = Progress.crNew(null, "Downloading xref task");
FileOutputStream oo = null;
InputStream ii =... | 0 |
[CLS] private void importDocument(String path, boolean detectParagraphs, Parser parser, ReadingAnnotationFilter filter, String encoding) {
try {
Reader in = null;
int contentlength = 0;
if (JGloss.messages.getString("encodings.default").equals(encoding)) encoding = null;
... | 0 |
[CLS] public void execute(HttpResponse response) throws HttpException, IOException {
Collection<Data> allData = internalDataBank.getAll();
StringBuffer content = new StringBuffer();
for (Data data : allData) {
content.append("keyHash:").append(data.getKeyHash()).append(", ");
... | 0 |
[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] public Document load(java.net.URL url) throws DOMTestLoadException {
Document doc = null;
try {
java.io.InputStream stream = url.openStream();
Object tidyObj = tidyConstructor.newInstance(new Object[0]);
doc = (Document) parseDOMMethod.invoke(tidyObj, new Object... | 0 |
[CLS] public static String md5Encode(String s) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(s.getBytes());
return toHexString(md.digest());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return s;
... | 1 |
[CLS] public static boolean copyFile(File from, File to, byte[] buf) {
if (buf == null) buf = new byte[BUFFER_SIZE];
FileInputStream from_s = null;
FileOutputStream to_s = null;
try {
from_s = new FileInputStream(from);
to_s = new FileOutputStream(to);
... | 1 |
[CLS] public void createControl(Composite parent) {
top = new Composite(parent, SWT.NONE);
top.setLayout(new GridLayout());
top.setLayoutData(new GridData(GridData.FILL_BOTH));
ComposedAdapterFactory factories = new ComposedAdapterFactory();
factories.addAdapterFactory(new EcoreI... | 0 |
[CLS] public void testRegisterFactory() throws Exception {
try {
new URL("classpath:/");
fail("MalformedURLException expected");
} catch (MalformedURLException e) {
assertTrue(true);
}
ClasspathURLConnection.registerFactory();
URL url = new URL... | 0 |
[CLS] public void copyFile(File s, File t) {
try {
FileChannel in = (new FileInputStream(s)).getChannel();
FileChannel out = (new FileOutputStream(t)).getChannel();
in.transferTo(0, s.length(), out);
in.close();
out.close();
} catch (Exception ... | 0 |
[CLS] public static BufferedReader openForReading(String name, URI base, ClassLoader classLoader) throws IOException {
if ((name == null) || name.trim().equals("")) {
return null;
}
if (name.trim().equals("System.in")) {
if (STD_IN == null) {
STD_IN = new ... | 0 |
[CLS] public Object run() {
try {
MessageDigest digest = MessageDigest.getInstance("SHA");
digest.update(buf.toString().getBytes());
byte[] data = digest.digest();
serialNum = new BASE64Encoder().encode(data);
... | 0 |
[CLS] public static void main(String[] args) {
RSSReader rssreader = new RSSReader();
try {
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser parser = factory.newPullParser();
String url = args[0];
InputStreamReader stream = ... | 0 |
[CLS] public Constructor run() throws Exception {
String path = "META-INF/services/" + ComponentApplicationContext.class.getName();
ClassLoader loader = Thread.currentThread().getContextClassLoader();
final Enumeration<URL> urls;
... | 0 |
[CLS] @Override
public DataUpdateResult<Record> archiveRecord(String authToken, Record record, Filter filter, Field sourceField, InputModel inputmodel) throws DataOperationException {
validateUserIsSignedOn(authToken);
validateUserHasAdminRights(authToken);
DataUpdateResult<Record> recordUpd... | 1 |
[CLS] public ResourceMigrator getCompletedResourceMigrator() {
return new ResourceMigrator() {
public void migrate(InputMetadata meta, InputStream inputStream, OutputCreator outputCreator) throws IOException, ResourceMigrationException {
OutputStr... | 1 |
[CLS] protected String readFileUsingHttp(String fileUrlName) {
String response = "";
try {
URL url = new URL(fileUrlName);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
httpConn.setRequestProp... | 1 |
[CLS] private static void processFile(StreamDriver driver, String sourceName) throws Exception {
String destName = sourceName + ".xml";
File dest = new File(destName);
if (dest.exists()) {
throw new IllegalArgumentException("File '" + destName + "' already exists!");
}
... | 1 |
[CLS] private String getMD5(String data) {
try {
MessageDigest md5Algorithm = MessageDigest.getInstance("MD5");
md5Algorithm.update(data.getBytes(), 0, data.length());
byte[] digest = md5Algorithm.digest();
StringBuffer hexString = new StringBuffer();
... | 1 |
[CLS] public boolean authorize(String username, String password, String filename) {
open(filename);
boolean isAuthorized = false;
StringBuffer encPasswd = null;
try {
MessageDigest mdAlgorithm = MessageDigest.getInstance("MD5");
mdAlgorithm.update(password.getByte... | 1 |
[CLS] @Override
protected Integer doInBackground() throws Exception {
int numOfRows = 0;
combinationMap = new HashMap<AnsweredQuestion, Integer>();
combinationMapReverse = new HashMap<Integer, AnsweredQuestion>();
LinkedHashSet<AnsweredQuestion> answeredQuestionSet = new LinkedHashSe... | 0 |
[CLS] public boolean login() {
if (super.isAuthenticated()) return true;
try {
if (client == null) {
client = new FTPClient();
FTPClientConfig config = new FTPClientConfig();
client.configure(config);
}
if (!client.isCon... | 1 |
[CLS] protected static String fileName2md5(String input) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.reset();
md.update(input.getBytes("iso-8859-1"));
byte[] byteHash = md.digest();
md.reset();
StringBuffer resultString ... | 0 |
[CLS] 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)), Base6... | 0 |
[CLS] public static void parseString(String str, String name) {
BufferedReader reader;
String zeile = null;
boolean firstL = true;
int lambda;
float intens;
int l_b = 0;
int l_e = 0;
HashMap<Integer, Float> curve = new HashMap<Integer, Float>();
St... | 1 |
[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] public static void copyFile(File src, File dest) throws IOException {
log.debug("Copying file: '" + src + "' to '" + dest + "'");
FileChannel srcChannel = new FileInputStream(src).getChannel();
FileChannel dstChannel = new FileOutputStream(dest).getChannel();
dstChannel.transferFro... | 1 |
[CLS] private static byte[] loadBytecodePrivileged() {
URL url = SecureCaller.class.getResource("SecureCallerImpl.clazz");
try {
InputStream in = url.openStream();
try {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
for (; ; ) {
... | 0 |
[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] public static final void... | 1 |
[CLS] public static void fileCopy(File src, File dest) throws IOException {
IOException xforward = null;
FileInputStream fis = null;
FileOutputStream fos = null;
FileChannel fcin = null;
FileChannel fcout = null;
try {
fis = new FileInputStream(src);
... | 0 |
[CLS] public static void loadConfig(URL urlFile) throws CacheException {
Document document;
try {
document = Utilities.getDocument(urlFile.openStream());
} catch (IOException e) {
throw new CacheException("Could not open '" + urlFile.getFile() + "'", e);
} catch (... | 0 |
[CLS] private static void loadFromZip() {
InputStream in = Resources.class.getResourceAsStream("data.zip");
if (in == null) {
return;
}
ZipInputStream zipIn = new ZipInputStream(in);
try {
while (true) {
ZipEntry entry = zipIn.getNextEntry(... | 1 |
[CLS] public static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOExc... | 1 |
[CLS] public static synchronized String encrypt(String plaintext) throws Exception {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(plaintext.getBytes("UTF-8"));
byte raw[] = md.digest();
return (new BASE64Encoder()).encode(raw);
} [SEP] public static String md5(Strin... | 1 |
[CLS] private void deleteProject(String uid, String home, HttpServletRequest request, HttpServletResponse response) throws Exception {
String project = request.getParameter("project");
String line;
response.setContentType("text/html");
PrintWriter out = response.getWriter();
html... | 1 |
[CLS] private void javaToHtml(File source, File destination) throws IOException {
Reader reader = new FileReader(source);
Writer writer = new FileWriter(destination);
JavaUtils.writeJava(reader, writer);
writer.flush();
writer.close();
} [SEP] public static String[] putFECSpl... | 1 |
[CLS] public void init() {
System.out.println("Init applet...");
int port = Integer.parseInt(getParameter("port"));
int useUDP = Integer.parseInt(getParameter("udp"));
boolean bUseUDP = false;
if (useUDP > 0) bUseUDP = true;
m_strWorld = getParameter("world");
m_s... | 0 |
[CLS] public void copy(File from, String to) throws SystemException {
assert from != null;
File dst = new File(folder, to);
dst.getParentFile().mkdirs();
FileChannel in = null;
FileChannel out = null;
try {
if (!dst.exists()) dst.createNewFile();
i... | 0 |
[CLS] public String getImageURL(String text) {
String imgURL = "";
try {
URL url = new URL("http://images.search.yahoo.com/search/images?p=" + URLEncoder.encode(text));
URLConnection connection = url.openConnection();
DataInputStream in = new DataInputStream(connectio... | 0 |
[CLS] protected byte[] computeHash() {
try {
final MessageDigest inputHash = MessageDigest.getInstance("SHA");
inputHash.update(bufferFileData().getBytes());
return inputHash.digest();
} catch (final NoSuchAlgorithmException nsae) {
lastException = nsae;
... | 0 |
[CLS] public static void copyFile(File source, File target) throws Exception {
if (source == null || target == null) {
throw new IllegalArgumentException("The arguments may not be null.");
}
try {
FileChannel srcChannel = new FileInputStream(source).getChannel();
... | 1 |
[CLS] public boolean sendMail(MailObject mail, boolean backup) throws NetworkException, ContentException {
HttpClient client = HttpConfig.newInstance();
HttpPost post = new HttpPost(HttpConfig.bbsURL() + HttpConfig.BBS_MAIL_SEND);
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
... | 0 |
[CLS] public static String get(String strUrl) {
try {
URL url = new URL(strUrl);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches(true);
conn.setAllowUserInt... | 0 |
[CLS] private static MapEntry<String, Properties> loadFpmConf() throws ConfigurationReadException {
MapEntry<String, Properties> ret = null;
Scanner sc = new Scanner(CONF_PATHS).useDelimiter(SEP_P);
String prev = "";
while (sc.hasNext() && !hasLoaded) {
Properties fpmConf = n... | 1 |
[CLS] public void writeTo(File f) throws IOException {
if (state != STATE_OK) throw new IllegalStateException("Upload failed");
if (tempLocation == null) throw new IllegalStateException("File already saved");
if (f.isDirectory()) f = new File(f, filename);
FileInputStream fis = new FileI... | 1 |
[CLS] private File copyFile(File file, String newName, File folder) {
File newFile = null;
if (!file.exists()) {
System.out.println("File " + file + " does not exist");
return null;
}
if (file.isFile()) {
BufferedOutputStream out = null;
Bu... | 1 |
[CLS] private static void executeSQLScript() {
File f = new File(System.getProperty("user.dir") + "/resources/umc.sql");
if (f.exists()) {
Connection con = null;
PreparedStatement pre_stmt = null;
try {
Class.forName("org.sqlite.JDBC");
... | 1 |
[CLS] public APIResponse delete(String id) throws Exception {
APIResponse response = new APIResponse();
connection = (HttpURLConnection) new URL(url + "/api/item/delete/" + id).openConnection();
connection.setRequestMethod("DELETE");
connection.setConnectTimeout(TIMEOUT);
connect... | 0 |
[CLS] private void CopyTo(File dest) throws IOException {
FileReader in = null;
FileWriter out = null;
int c;
try {
in = new FileReader(image);
out = new FileWriter(dest);
while ((c = in.read()) != -1) out.write(c);
} finally {
if (... | 1 |
[CLS] public static void main(String[] args) {
FileInputStream fr = null;
FileOutputStream fw = null;
BufferedInputStream br = null;
BufferedOutputStream bw = null;
try {
fr = new FileInputStream("D:/5.xls");
fw = new FileOutputStream("c:/Dxw.java");
... | 1 |
[CLS] @Override
public void downloadByUUID(final UUID uuid, final HttpServletRequest request, final HttpServletResponse response) throws IOException {
if (!exportsInProgress.containsKey(uuid)) {
throw new IllegalStateException("No download with UUID: " + uuid);
}
final File compr... | 1 |
[CLS] public boolean uploadFromServlet(InputStream is, String serverFileName, String serverPath, String serverUrl, int serverPort, String userName, String passWord) throws IOException {
FTPClient ftp = new FTPClient();
FTPClientConfig conf = new FTPClientConfig();
conf.setServerLanguageCode("zh_... | 0 |
[CLS] public void deleteUser(User portalUserBean, AuthSession authSession) {
DatabaseAdapter dbDyn = null;
PreparedStatement ps = null;
try {
dbDyn = DatabaseAdapter.getInstance();
if (portalUserBean.getUserId() == null) throw new IllegalArgumentException("id of portal us... | 0 |
[CLS] private static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOEx... | 1 |
[CLS] public String tranportRemoteUnitToLocalTempFile(String urlStr) throws UnitTransportException {
InputStream input = null;
BufferedOutputStream bos = null;
File tempUnit = null;
try {
URL url = null;
int total = 0;
try {
url = new U... | 1 |
[CLS] private void copy(File fromFile, File toFile) throws IOException {
String fromFileName = fromFile.getName();
File tmpFile = new File(fromFileName);
String toFileName = toFile.getName();
if (!tmpFile.exists()) throw new IOException("FileCopy: " + "no such source file: " + fromFileNa... | 1 |
[CLS] @SuppressWarnings("unchecked")
public static <T> List<T> getServices(String service) {
String serviceUri = "META-INF/services/" + service;
ClassLoader loader = Thread.currentThread().getContextClassLoader();
try {
Enumeration<URL> urls = loader.getResources(serviceUri);
... | 1 |
[CLS] @SuppressWarnings("unused")
private String getMD5(String value) {
MessageDigest md5;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
return "";
}
md5.reset();
md5.update(value.getBytes());
byte... | 1 |
[CLS] protected String getPostRequestContent(String urlText, String postParam) throws Exception {
URL url = new URL(urlText);
HttpURLConnection urlcon = (HttpURLConnection) url.openConnection();
String line = null;
try {
urlcon.setRequestMethod("POST");
urlcon.set... | 0 |
[CLS] public static void saveNetFile(String destUrl, String fileName) throws IOException {
FileOutputStream fos = null;
BufferedInputStream bis = null;
HttpURLConnection httpUrl = null;
int BUFFER_SIZE = 2048;
URL url = null;
byte[] buf = new byte[BUFFER_SIZE];
in... | 0 |
[CLS] @Override
public boolean exists() {
if (local_file.exists()) {
return true;
} else {
try {
URLConnection c = remote_url.openConnection();
try {
c.setConnectTimeout(CIO.getLoadingTimeOut(... | 0 |
[CLS] private static void readIzvestiyaArticles() throws IOException {
CsvReader reader = new CsvReader(new InputStreamReader(IzvestiyaUtil.class.getClassLoader().getResourceAsStream("mathnet_izvestiya.csv")), ';');
reader.setTrimWhitespace(true);
try {
while (reader.readRecord()) {
... | 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] public static void refresh() {
URL[] urls = Constants.Wiki2xhtml.getUpdateURLs();
content.setLength(0);
InputStream is = null;
BufferedReader br = null;
for (int i = 0; i < urls.length; i++) {
try {
is = urls[i].openStream();
br =... | 0 |
[CLS] public void importarBancoDeDadosDARI(File pArquivoXLS, Andamento pAndamento) throws IOException, SQLException, InvalidFormatException {
final String ABA_VALOR_DE_MERCADO = "Valor de Mercado";
final int COLUNA_DATA = 1, COLUNA_ANO = 6, COLUNA_VALOR_DE_MERCADO_DIARIO_EM_BILHOES_DE_REAIS = 2, COLUNA_... | 0 |
[CLS] public static Image load(final InputStream input, String format, Point dimension) throws CoreException {
MultiStatus status = new MultiStatus(GraphVizActivator.ID, 0, "Errors occurred while running Graphviz", null);
File dotInput = null, dotOutput = null;
ByteArrayOutputStream dotContents ... | 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] void readData() {
String[] nextLine;
int line;
double value;
URL url = null;
String FileToRead;
try {
for (int i = 0; i < names.length; i++) {
FileToRead = "data/" + names[i] + ".csv";
url = new URL(ja.getCodeBase(), FileT... | 0 |
[CLS] public In(URL url) {
try {
URLConnection site = url.openConnection();
InputStream is = site.getInputStream();
scanner = new Scanner(is, charsetName);
scanner.useLocale(usLocale);
} catch (IOException ioe) {
System.err.println("Could not o... | 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... | 0 |
[CLS] public void testSendMessage() throws ClientProtocolException, IOException {
String textMessage = "La%20sua%20prenotazione%20e60%20andata%20a%20buon%20fine";
String customerPhoneNumber = "+393345730726";
DefaultHttpClient httpclient = new DefaultHttpClient();
String other = "http://... | 0 |
[CLS] public static String obterConteudoSite(String u) {
URL url;
try {
url = new URL(u);
URLConnection conn = null;
if (proxy != null) conn = url.openConnection(proxy.getProxy()); else conn = url.openConnection();
conn.setDoOutput(true);
Buffe... | 0 |
[CLS] 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 = n... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.