text string | label int64 |
|---|---|
[CLS] public static Vector getMetaKeywordsFromURL(String p_url) throws Exception {
URL x_url = new URL(p_url);
URLConnection x_conn = x_url.openConnection();
InputStreamReader x_is_reader = new InputStreamReader(x_conn.getInputStream());
BufferedReader x_reader = new BufferedReader(x_is_... | 0 |
[CLS] public static void decryptFile(String input, String output, String pwd) throws Exception {
CipherInputStream in;
OutputStream out;
Cipher cipher;
SecretKey key;
byte[] byteBuffer;
cipher = Cipher.getInstance("DES");
key = new SecretKeySpec(pwd.getBytes(), "D... | 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()) {
... | 0 |
[CLS] private String sendImpl(String from, String destNumber, String text) throws IOException {
final QueryStringBuilder query = new QueryStringBuilder();
query.append("user", username);
query.append("password", password);
query.append("api_id", apiId);
query.append("to", destNum... | 0 |
[CLS] @Override
public void sendContent(OutputStream out, Range range, Map<String, String> params, String contentType) throws IOException, NotAuthorizedException, BadRequestException, NotFoundException {
try {
resolveFileAttachment();
} catch (NoFileByTheIdException e) {
thro... | 1 |
[CLS] private String callPage(String urlStr) throws IOException {
URL url = new URL(urlStr);
BufferedReader reader = null;
StringBuilder result = new StringBuilder();
try {
reader = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
... | 0 |
[CLS] 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();
f... | 0 |
[CLS] public HttpURLConnection getConnection(String urlString) throws IOException {
URL url = new URL(urlString);
HttpURLConnection connection = null;
if (_proxy == null) {
connection = (HttpURLConnection) url.openConnection();
} else {
URLConnection con = url.ope... | 0 |
[CLS] public static JsonNode getJSONFromURL(String httpUrl) throws Exception {
URL url;
InputStream inputStream = null;
DataInputStream dataInputStream;
try {
url = new URL(httpUrl);
inputStream = url.openStream();
dataInputStream = new DataInputStream... | 0 |
[CLS] public static void copyFile(File file, File destination) throws Exception {
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
in = new BufferedInputStream(new FileInputStream(file));
out = new BufferedOutputStream(new FileOutputStream(destination... | 1 |
[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.B64InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Ba... | 0 |
[CLS] public static void copy(File source, File dest) throws FileNotFoundException, IOException {
FileInputStream input = new FileInputStream(source);
FileOutputStream output = new FileOutputStream(dest);
System.out.println("Copying " + source + " to " + dest);
IOUtils.copy(input, output... | 1 |
[CLS] public static void copyFile(final String src, final String dest) {
Runnable r1 = new Runnable() {
public void run() {
try {
File inf = new File(dest);
if (!inf.exists()) {
inf.getParentFile().mkdirs();
... | 1 |
[CLS] public static String createMD5(String str) {
String sig = null;
String strSalt = str + sSalt;
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(strSalt.getBytes(), 0, strSalt.length());
byte byteData[] = md5.digest();
Str... | 1 |
[CLS] private void prepareJobFile(ZipEntryRef zer, String nodeDir, String reportDir, Set<ZipEntryRef> statusZers) throws Exception {
String jobDir = nodeDir + File.separator + "job_" + zer.getUri();
if (!isWorkingDirectoryValid(jobDir)) {
throw new Exception("Cannot acces to " + jobDir);
... | 0 |
[CLS] public static String encodeMD5(String value) {
String result = "";
try {
MessageDigest md = MessageDigest.getInstance("MD5");
BASE64Encoder encoder = new BASE64Encoder();
md.update(value.getBytes());
byte[] raw = md.digest();
result = enc... | 1 |
[CLS] private String getCurrentUniprotAccession(String accession) throws Exception {
URL url = new URL(String.format(UNIPROT_ENTRY_QUERY_STRING, accession));
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
HttpURLConnection.setFollowRedirects(true);
connection.se... | 0 |
[CLS] public static void main(String[] args) throws Exception {
String linesep = System.getProperty("line.separator");
FileOutputStream fos = new FileOutputStream(new File("lib-licenses.txt"));
fos.write(new String("JCP contains the following libraries. Please read this for comments on copyright... | 1 |
[CLS] private void execute(String file, String[] ebms, String[] eems, String[] ims, String[] efms) throws BuildException {
if (verbose) {
System.out.println("Preprocessing file " + file + " (type: " + type + ")");
}
try {
File targetFile = new File(file);
File... | 1 |
[CLS] public static void copyFile(File src, File dest) throws IOException {
FileInputStream fis = new FileInputStream(src);
FileOutputStream fos = new FileOutputStream(dest);
java.nio.channels.FileChannel channelSrc = fis.getChannel();
java.nio.channels.FileChannel channelDest = fos.getC... | 1 |
[CLS] public static void copyFile(String source, String destination, boolean overwrite) {
File sourceFile = new File(source);
try {
File destinationFile = new File(destination);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(sourceFile));
Buffer... | 0 |
[CLS] void IconmenuItem6_actionPerformed(ActionEvent e) {
JFileChooser jFileChooser1 = new JFileChooser();
String separator = "";
if (JFileChooser.APPROVE_OPTION == jFileChooser1.showOpenDialog(this.getFatherFrame())) {
setDefaultPath(jFileChooser1.getSelectedFile().getPath());
... | 1 |
[CLS] public static boolean insert(final CelulaFinanceira objCelulaFinanceira) {
int result = 0;
final Connection c = DBConnection.getConnection();
PreparedStatement pst = null;
if (c == null) {
return false;
}
try {
c.setAutoCommit(false);
... | 1 |
[CLS] public static void copyFile(File in, File outDir) throws IOException {
FileChannel sourceChannel = null;
FileChannel destinationChannel = null;
try {
sourceChannel = new FileInputStream(in).getChannel();
File out = new File(outDir, in.getName());
destina... | 1 |
[CLS] @Override
protected String doInBackground(Location... params) {
if (params == null || params.length == 0 || params[0] == null) {
return null;
}
Location location = params[0];
String address = "";
String... | 0 |
[CLS] private static String encryptSHA1URL(String x) throws Exception {
java.security.MessageDigest d = null;
d = java.security.MessageDigest.getInstance("SHA-1");
d.reset();
d.update(x.getBytes());
String passwd = "";
passwd = URLEncoder.encode(new String(d.digest()), "I... | 1 |
[CLS] public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
String act = request.getParameter("act");
if (null == act) {
} else if ("down".equalsIgnoreCase(act)) {
String vest = request.getPar... | 0 |
[CLS] public static void writeFullImageToStream(Image scaledImage, String javaFormat, OutputStream os) throws IOException {
BufferedImage bufImage = new BufferedImage(scaledImage.getWidth(null), scaledImage.getHeight(null), BufferedImage.TYPE_BYTE_BINARY);
Graphics gr = bufImage.getGraphics();
g... | 1 |
[CLS] private void zipdir(File base, String zipname) throws IOException {
FilenameFilter ff = new ExporterFileNameFilter();
String[] files = base.list(ff);
File zipfile = new File(base, zipname + ".zip");
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipfile));
b... | 0 |
[CLS] public void applyTo(File source, File target) throws IOException {
boolean failed = true;
FileInputStream fin = new FileInputStream(source);
try {
FileChannel in = fin.getChannel();
FileOutputStream fos = new FileOutputStream(target);
... | 0 |
[CLS] public void transaction() {
String delPets = "delete from PETS where PERSON_ID = 1";
String delPersons = "delete from PERSONS where PERSON_ID = 1";
if (true) {
System.out.println(delPets);
System.out.println(delPersons);
}
Connection conn = null;
... | 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... | 0 |
[CLS] public Service findServiceFor(final int serviceID) throws JAXBException, IOException, BadResponseException {
final String USER_AGENT = "SBSIVisual (CSBE, University of Edinburgh)";
String urlToConnectTo = "http://www.biocatalogue.org/services/" + serviceID;
URL url = new URL(urlToConnectTo... | 0 |
[CLS] @Override
protected void copyContent(String filename) throws IOException {
InputStream in = null;
try {
String resourceDir = System.getProperty("resourceDir");
File resource = new File(resourceDir, filename);
ByteArrayOutputStream out... | 1 |
[CLS] private String encryptPassword(String password) {
String result = password;
if (password != null) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.reset();
md5.update(password.getBytes());
BigInteger hash ... | 0 |
[CLS] public static int executeUpdate(EOAdaptorChannel channel, String sql, boolean autoCommit) throws SQLException {
int rowsUpdated;
boolean wasOpen = channel.isOpen();
if (!wasOpen) {
channel.openChannel();
}
Connection conn = ((JDBCContext) channel.adaptorContext(... | 1 |
[CLS] protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setCharacterEncoding("UTF-8");
try {
String content = "";
URL url = new URL(request.getParameter("url"));
URLConnection connection = ur... | 1 |
[CLS] private ByteBuffer readProgram(URL url) throws IOException {
StringBuilder program = new StringBuilder();
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = in.readLine()) != null... | 1 |
[CLS] public void copyFile2(String src, String dest) throws IOException {
FileWriter fw = null;
FileReader fr = null;
BufferedReader br = null;
BufferedWriter bw = null;
File source = null;
try {
fr = new FileReader(src);
fw = new FileWriter(dest);... | 0 |
[CLS] public boolean update(int idJugador, jugador jugadorModificado) {
int intResult = 0;
String sql = "UPDATE jugador " + "SET apellidoPaterno = ?, apellidoMaterno = ?, nombres = ?, fechaNacimiento = ?, " + " pais = ?, rating = ?, sexo = ? " + " WHERE idJugador = " + idJugador;
try {
... | 0 |
[CLS] public static IProject createSimplemodelEnabledJavaProject() throws CoreException {
IWorkspaceDescription desc = ResourcesPlugin.getWorkspace().getDescription();
desc.setAutoBuilding(false);
ResourcesPlugin.getWorkspace().setDescription(desc);
String name = "TestProject";
f... | 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 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] public static String getByUrl(String urlStr, String para) {
URL url;
StringBuffer html = new StringBuffer("");
try {
url = new URL(urlStr);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
... | 0 |
[CLS] private String getTextResponse(String address) throws Exception {
URL url = new URL(address);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setUseCaches(false);
BufferedReader in = null;
try {
con.connect();
assertEquals(HttpU... | 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 byte[] generatePasswordHash(String s) {
byte[] password = { 00 };
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(s.getBytes());
password = md5.digest();
return password;
} catch (NoSuchAlgorithmException ... | 0 |
[CLS] private void calculateCoverageAndSpecificity(String mainCat) throws IOException, JSONException {
for (String cat : Rules.categoryTree.get(mainCat)) {
for (String queryString : Rules.queries.get(cat)) {
String urlEncodedQueryString = URLEncoder.encode(queryString, "UTF-8");
... | 0 |
[CLS] public void loadJar(final String extName, final String url, final String fileName, final IProgressListener pl) throws Exception {
pl.setName(fileName);
pl.setProgress(0);
pl.setFinished(false);
pl.setStarted(true);
String installDirName = extDir + File.separator + extName;
... | 0 |
[CLS] @Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException {
PrintWriter writer = null;
InputStream is = null;
FileOutputStream fos = null;
try {
writer = response.getWriter();
} catch (IOException ex) {... | 1 |
[CLS] public TVRageShowInfo(String xmlShowName) {
String[] tmp, tmp2;
String line = "";
this.usrShowName = xmlShowName;
try {
URL url = new URL("http://www.tvrage.com/quickinfo.php?show=" + xmlShowName.replaceAll(" ", "%20"));
BufferedReader in = new BufferedReade... | 1 |
[CLS] private InputStream openConnection(URL url) throws IOException, DODSException {
connection = url.openConnection();
if (acceptDeflate) connection.setRequestProperty("Accept-Encoding", "deflate");
connection.connect();
InputStream is = null;
int retry = 1;
long backof... | 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] private String getXML(String url) throws ClientProtocolException, IOException {
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(url);
HttpResponse responseGet = client.execute(get);
HttpEntity resEntityGet = responseGet.getEntity();
BufferedReader in ... | 1 |
[CLS] private String unzip(TupleInput input) {
boolean zipped = input.readBoolean();
if (!zipped) {
return input.readString();
}
int len = input.readInt();
try {
byte array[] = new byte[len];
input.read(array);
... | 1 |
[CLS] public void removeBodyPart(int iPart) throws MessagingException, ArrayIndexOutOfBoundsException {
if (DebugFile.trace) {
DebugFile.writeln("Begin DBMimeMultipart.removeBodyPart(" + String.valueOf(iPart) + ")");
DebugFile.incIdent();
}
DBMimeMessage oMsg = (DBMimeMes... | 0 |
[CLS] private void displayDiffResults() throws IOException {
File outFile = File.createTempFile("diff", ".htm");
outFile.deleteOnExit();
FileOutputStream outStream = new FileOutputStream(outFile);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outStream));
out.wri... | 0 |
[CLS] private void copy(File sourceFile, File destinationFile) {
try {
FileChannel in = new FileInputStream(sourceFile).getChannel();
FileChannel out = new FileOutputStream(destinationFile).getChannel();
try {
in.transferTo(0, in.size(), out);
... | 0 |
[CLS] public static void main(String[] args) {
FileInputStream in;
DeflaterOutputStream out;
FileOutputStream fos;
FileDialog fd;
fd = new FileDialog(new Frame(), "Find a file to deflate", FileDialog.LOAD);
fd.show();
if (fd.getFile() != null) {
try {
... | 1 |
[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] static byte[] getPassword(final String name, final String password) {
try {
final MessageDigest messageDigest = MessageDigest.getInstance("SHA");
messageDigest.update(name.getBytes());
messageDigest.update(password.getBytes());
return messageDigest.digest();... | 1 |
[CLS] private void displayDiffResults() throws IOException {
File outFile = File.createTempFile("diff", ".htm");
outFile.deleteOnExit();
FileOutputStream outStream = new FileOutputStream(outFile);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(outStream));
out.wri... | 1 |
[CLS] private Element returnAnnoBody(final String url) {
DOMParser parser = new DOMParser();
try {
URL bodyURL = new URL(url);
URLConnection url_con = bodyURL.openConnection();
if (useAuthorization()) {
url_con.setRequestProperty("Authorization", "Basi... | 0 |
[CLS] public static synchronized String toMD5(String str) {
Nulls.failIfNull(str, "Cannot create an MD5 encryption form a NULL string");
String hashword = null;
try {
MessageDigest md5 = MessageDigest.getInstance(MD5);
md5.update(str.getBytes());
BigInteger ha... | 0 |
[CLS] public static void testclass(String[] args) throws IOException, CodeCheckException {
ClassWriter writer = new ClassWriter();
writer.emptyClass(ClassWriter.ACC_PUBLIC, "TestClass", "java/lang/Object");
MethodInfo newMethod = writer.addMethod(ClassWriter.ACC_PUBLIC | ClassWriter.ACC_STATIC, ... | 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... | 1 |
[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] private String endcodePassword(String password) throws UnsupportedEncodingException, NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(password.getBytes("UTF-8"));
byte raw[] = md.digest();
Base64 base64 = new Base64();
String hash = ... | 1 |
[CLS] private static void doCopyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException {
if (destFile.exists() && destFile.isDirectory()) {
throw new IOException("Destination '" + destFile + "' exists but is a directory");
}
FileInputStream input = new FileInp... | 1 |
[CLS] private void readFromFile1() throws DException {
URL url1 = null;
if (url == null) {
url = getClass().getResource("/com/daffodilwoods/daffodildb/utils/parser/parser.schema");
try {
url = new URL(url.getProtocol() + ":" + url.getPath().substring(0, url.getPat... | 0 |
[CLS] public Boolean compress(String sSourceDir, ArrayList<String> aFiles, String sDestinationFilename) {
logger.debug("compress(%s, %s, %s)", sSourceDir, aFiles, sDestinationFilename);
BufferedInputStream oOrigin = null;
FileOutputStream oDestination;
ZipOutputStream oOutput = null;
... | 1 |
[CLS] public String quebraLink(String link) throws StringIndexOutOfBoundsException {
link = link.replace(".url", "");
int cod = 0;
final String linkInit = link.replace("#", "");
boolean estado = false;
char letra;
String linkOrig;
String newlink = "";
link... | 0 |
[CLS] private Attachment setupSimpleAttachment(Context context, long messageId, boolean withBody) throws IOException {
Attachment attachment = new Attachment();
attachment.mFileName = "the file.jpg";
attachment.mMimeType = "image/jpg";
attachment.mSize = 0;
attachment.mContentId ... | 1 |
[CLS] public static String doGetWithBasicAuthentication(URL url, String username, String password, int timeout, Map<String, String> headers) throws Throwable {
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setDoInput(true);
if (usernam... | 1 |
[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] private Datastream addManagedDatastreamVersion(Entry entry) throws StreamIOException, ObjectIntegrityException {
Datastream ds = new DatastreamManagedContent();
setDSCommonProperties(ds, entry);
ds.DSLocationType = "INTERNAL_ID";
ds.DSMIME = getDSMimeType(entry);
IRI conten... | 1 |
[CLS] public void actionPerformed(ActionEvent event) {
System.out.println("STARTING on" + getQueryField().getText());
try {
URL url = new URL(getQueryField().getText());
getResponseField().setText("opening URL");
DataInputStream inputStream = new D... | 0 |
[CLS] private synchronized void ensureParsed() throws IOException, BadIMSCPException {
if (cp != null) return;
if (on_disk == null) {
on_disk = createTemporaryFile();
OutputStream to_disk = new FileOutputStream(on_disk);
IOUtils.copy(in.getInputStream(), to_disk);
... | 0 |
[CLS] private void startOpening(final URL url) {
final WebAccessor wa = this;
openerThread = new Thread() {
public void run() {
iStream = null;
try {
tryProxy = false;
URLConnection connection = url.openConnection();
... | 0 |
[CLS] public static void decryptFile(String input, String output, String pwd) throws Exception {
CipherInputStream in;
OutputStream out;
Cipher cipher;
SecretKey key;
byte[] byteBuffer;
cipher = Cipher.getInstance("DES");
key = new SecretKeySpec(pwd.getBytes(), "D... | 1 |
[CLS] public static boolean copyFile(File from, File tu) {
final int BUFFER_SIZE = 4096;
byte[] buffer = new byte[BUFFER_SIZE];
try {
FileInputStream in = new FileInputStream(from);
FileOutputStream out = new FileOutputStream(tu);
int read;
while (... | 1 |
[CLS] public synchronized void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
CacheEntry entry = null;
Tenant tenant = null;
if (!tenantInfo.getTenants().isEmpty()) {
tenant = tenantInfo.getMatchingTenant(request);
... | 1 |
[CLS] public static InputStream getInputStream(URL url) throws IOException {
if (url.getProtocol().equals("resource")) {
Resources res = SpeakReceiver._context.getResources();
String resname = url.getFile();
resname = resname.split("\\.[a-z0-9]{3}")[0];
int id = r... | 0 |
[CLS] private static void loadCommandList() {
final URL url;
try {
url = IOUtils.getResource(null, PYTHON_MENU_FILE);
} catch (final FileNotFoundException ex) {
log.error("File '" + PYTHON_MENU_FILE + "': " + ex.getMessage());
return;
}
final L... | 1 |
[CLS] @Before
public void BeforeTheTest() throws Exception {
URL url = ProfileParserTest.class.getClassLoader().getResource("ca/uhn/hl7v2/conf/parser/tests/example_ack.xml");
URLConnection conn = url.openConnection();
InputStream instream = conn.getInputStream();
if (instream == null... | 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;... | 0 |
[CLS] @Nullable
@Override
public InputSource resolveEntity(final String publicId, final String systemId) throws IOException {
if (systemId.endsWith(".xml")) {
return null;
}
InputSource inputSource = null;
final URL url = IOUtils.getResourc... | 0 |
[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... | 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 void fetchFile(String ID) {
String url = "http://www.nal.usda.gov/cgi-bin/agricola-ind?bib=" + ID + "&conf=010000++++++++++++++&screen=MA";
System.out.println(url);
try {
PrintWriter pw = new PrintWriter(new FileWriter("MARC" + ID + ".txt"));
if (!id.contains... | 0 |
[CLS] public static int fileUpload(long lngFileSize, InputStream inputStream, String strFilePath, String strFileName) throws IOException {
String SEPARATOR = System.getProperty("file.separator");
if (lngFileSize > (10 * 1024 * 1024)) {
return -1;
}
InputStream is = null;
... | 1 |
[CLS] public void importarHistoricoDeProventos(File pArquivoXLS, boolean pFiltrarPelaDataDeCorteDoCabecalho, Andamento pAndamento) throws IOException, SQLException, InvalidFormatException {
int iLinha = -1;
String nomeDaColuna = "";
Statement stmtLimpezaInicialDestino = null;
OraclePrepa... | 1 |
[CLS] public static void copyAFile(final String entree, final String sortie) {
FileChannel in = null;
FileChannel out = null;
try {
in = new FileInputStream(entree).getChannel();
out = new FileOutputStream(sortie).getChannel();
in.transferTo(0, in.size(), out)... | 1 |
[CLS] public static void copyFile(File from, File to) throws FileNotFoundException, IOException {
requireFile(from);
requireFile(to);
if (to.isDirectory()) {
to = new File(to, getFileName(from));
}
FileChannel sourceChannel = new FileInputStream(from).getChannel();
... | 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;... | 0 |
[CLS] private void loadProperties() {
if (properties == null) {
properties = new Properties();
try {
URL url = getClass().getResource(propsFile);
properties.load(url.openStream());
} catch (IOException ioe) {
ioe.printStackTrace... | 0 |
[CLS] private void chopFileDisk() throws IOException {
File tempFile = new File("" + logFile + ".tmp");
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
long startCopyPos;
byte readBuffer[] = new byte[2048];
int readCount;
long totalBytesRead = 0;
... | 1 |
[CLS] static void copyFile(File file, File destDir) {
File destFile = new File(destDir, file.getName());
if (destFile.exists() && (!destFile.canWrite())) {
throw new SyncException("Cannot overwrite " + destFile + " because " + "it is read-only");
}
try {
FileInput... | 1 |
[CLS] private void readURL(URL url) throws IOException {
statusLine.setText("Opening " + url.toExternalForm());
URLConnection connection = url.openConnection();
StringBuffer buffer = new StringBuffer();
BufferedReader in = null;
try {
in = new BufferedReader(new Input... | 0 |
[CLS] public static void createZipFromDataset(String localResourceId, File dataset, File metadata) {
CommunicationLogger.warning("System entered ZipFactory");
try {
String tmpDir = System.getProperty("java.io.tmpdir");
String outFilename = tmpDir + "/" + localResourceId + ".zip";... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.