text string | label int64 |
|---|---|
[CLS] protected void setUp() throws Exception {
super.setUp();
bundles = Activator.bundleContext.getBundles();
for (int i = 0; i < bundles.length; ++i) {
if (bundles[i] != null) {
if ((bundles[i].getSymbolicName() == null) || (!bundles[i].getSymbolicName().startsWith(... | 0 |
[CLS] protected void migrateOnDemand() {
try {
if (fso.fileExists(prefix + ".fat") && !fso.fileExists(prefix + EXTENSIONS[UBM_FILE])) {
RandomAccessFile ubm, meta, ctr, rbm;
InputStream inputStream;
OutputStream outputStream;
fso.rename... | 1 |
[CLS] public final boolean login(String user, String pass) {
if (user == null || pass == null) return false;
connectionInfo.setData("com.tensegrity.palojava.pass#" + user, pass);
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(pass.getBytes());
... | 0 |
[CLS] private int[] get51JobId(String address, String category, int pageNum) {
StringBuffer htmlContent = null;
try {
URL url = new URL(ConfigJob51.STR_51JOB_ADVANCE);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
OutputStr... | 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 String md5(String value) {
String md5Value = "1";
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(value.getBytes());
md5Value = getHex(digest.digest());
} catch (Exception e) {
e.printStackTrace();
... | 0 |
[CLS] public static void main(String[] args) throws Exception {
if (args.length != 2) {
PrintUtil.prt("arguments: sourcefile, destfile");
System.exit(1);
}
FileChannel in = new FileInputStream(args[0]).getChannel(), out = new FileOutputStream(args[1]).getChannel();
... | 1 |
[CLS] @Override
protected Control createDialogArea(final Composite parent) {
this.area = new Composite((Composite) super.createDialogArea(parent), SWT.NONE);
this.area.setLayout(new FillLayout());
this.area.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
this.scrolledCom... | 0 |
[CLS] public void copyFile2(String src, String dest) throws IOException {
String newLine = System.getProperty("line.separator");
FileWriter fw = null;
FileReader fr = null;
BufferedReader br = null;
BufferedWriter bw = null;
File source = null;
try {
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 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... | 1 |
[CLS] public static void perform(ChangeSet changes, ArchiveInputStream in, ArchiveOutputStream out) throws IOException {
ArchiveEntry entry = null;
while ((entry = in.getNextEntry()) != null) {
System.out.println(entry.getName());
boolean copy = true;
for (Iterator it... | 1 |
[CLS] public void alterarQuestaoDiscursiva(QuestaoDiscursiva q) throws SQLException {
PreparedStatement stmt = null;
String sql = "UPDATE discursiva SET gabarito=? WHERE id_questao=?";
try {
stmt = conexao.prepareStatement(sql);
stmt.setString(1, q.getGabarito());
... | 1 |
[CLS] public static JSONArray getFriends(long[] uids) throws ClientProtocolException, IOException, JSONException {
HttpClient client = new DefaultHttpClient(params);
HttpPost post = new HttpPost(FRIENDS_URI);
List<NameValuePair> parameters = new ArrayList<NameValuePair>();
parameters.add... | 0 |
[CLS] protected BufferedImage handleFirenzeException() {
if (params.uri.indexOf("bncf.firenze.sbn.it") != -1) try {
params.uri = params.uri.replace("http://opac.bncf.firenze.sbn.it/mdigit/jsp/mdigit.jsp?idr", "http://teca.bncf.firenze.sbn.it/TecaViewer/index.jsp?RisIdr");
URLConnection c... | 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();... | 0 |
[CLS] public boolean copy(String file, String target, int tag) {
try {
File file_in = new File(file);
File file_out = new File(target);
File parent = file_out.getParentFile();
parent.mkdirs();
FileInputStream in1 = new FileInputStream(file_in);
... | 1 |
[CLS] protected void convertInternal(InputStream inputStream, DocumentFormat inputFormat, OutputStream outputStream, DocumentFormat outputFormat) {
File inputFile = null;
File outputFile = null;
try {
inputFile = File.createTempFile("document", "." + inputFormat.getFileExtension());
... | 1 |
[CLS] private static String hashPassword(String password) {
try {
String hashword = null;
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(password.getBytes());
BigInteger hash = new BigInteger(1, md5.digest());
hashword = hash.toString... | 1 |
[CLS] protected void runTests(URL pBaseURL, String pName, String pHref) throws Exception {
URL url = new URL(pBaseURL, pHref);
InputSource isource = new InputSource(url.openStream());
isource.setSystemId(url.toString());
Document document = getDocumentBuilder().parse(isource);
No... | 0 |
[CLS] public void convert(String newDocumentName, URL url) throws IOException {
documentPath = createDirectoryStructure(this.destinationPath, newDocumentName);
try {
Document doc = builder.build(url.openStream());
Element elementx = doc.getRootElement();
convertElemen... | 0 |
[CLS] public URL rawGetURLfromWebID(String id) {
try {
System.out.println("Resolving id" + id);
String resolve = "/webid/ResolverServlet?wpid=MeetingMachine&method=form&uri=" + id + "&href=_[text/url]";
String resolver = "http://webid.hpl.hp.com:5190";
URL url = n... | 0 |
[CLS] private FileInputStream getPackageStream(String archivePath) throws IOException, PackageManagerException {
final int lastSlashInName = filename.lastIndexOf("/");
final String newFileName = filename.substring(lastSlashInName);
File packageFile = new File((new StringBuilder()).append(archive... | 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 void openAndClose(ZKEntry zke, LinkedList toOpen, LinkedList toRemove) throws SQLException {
conn.setAutoCommit(false);
try {
Statement stm = conn.createStatement();
ResultSet rset = stm.executeQuery("SELECT now();");
rset.next();
Timestamp no... | 0 |
[CLS] public void imagesParserAssesmentItem(int file, int currentquestion, Resource resTemp) {
NodeList nl = null;
Node n = null;
NamedNodeMap nnp = null;
Node nsrc = null;
URL url = null;
String sFilename = "";
String sNewPath = "";
int index;
Str... | 1 |
[CLS] public ActualTask(TEditor editor, TIGDataBase dataBase, String directoryPath) {
File myDirectory = new File(directoryPath);
String[] list = myDirectory.list();
int i;
for (i = 0; ((i < list.length) && !stop); i++) {
current = i;
if ((... | 1 |
[CLS] public boolean refresh() {
try {
synchronized (text) {
stream = (new URL(url)).openStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
String line;
StringBuilder sb = new StringBuilder();
... | 1 |
[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);
}
... | 0 |
[CLS] @Override
public boolean setupDatabaseSchema() {
Configuration cfg = Configuration.getInstance();
Connection con = getConnection();
if (null == con) return false;
try {
String sql = FileTool.readFile(cfg.getProperty("database.sql.rootdir") + System.getProperty("file... | 1 |
[CLS] public void elimina(Pedido pe) throws errorSQL, errorConexionBD {
System.out.println("GestorPedido.elimina()");
int id = pe.getId();
String sql;
Statement stmt = null;
try {
gd.begin();
sql = "DELETE FROM pedido WHERE id=" + id;
System.ou... | 1 |
[CLS] public static String getStringResponse(String urlString) throws Exception {
URL url = new URL(urlString);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
StringBuilder buffer = new StringBuilder();
while ((inputLine = in.re... | 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] private void trainDepParser(byte flag, JarArchiveOutputStream zout) throws Exception {
AbstractDepParser parser = null;
OneVsAllDecoder decoder = null;
if (flag == ShiftPopParser.FLAG_TRAIN_LEXICON) {
System.out.println("\n* Save lexica");
if (s_depParser.equals(Abs... | 1 |
[CLS] public void objectParserAssesmentItem(int file, int currentquestion, Resource resTemp) {
NodeList nl = null;
Node n = null;
NamedNodeMap nnp = null;
Node nsrc = null;
URL url = null;
String sFilename = "";
String sNewPath = "";
int indexLastSeparator... | 1 |
[CLS] public static boolean downloadFile(String srcUri, String srcDest) {
try {
URL url = new URL(srcUri);
InputStream is = url.openStream();
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(srcDest));
byte[] buff = new byte[10000];
... | 0 |
[CLS] private static String genRandomGUID(boolean secure) {
String valueBeforeMD5 = "";
String valueAfterMD5 = "";
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgori... | 1 |
[CLS] private String signMethod() {
String str = API.SHARED_SECRET;
Vector<String> v = new Vector<String>(parameters.keySet());
Collections.sort(v);
for (String key : v) {
str += key + parameters.get(key);
}
MessageDigest m = null;
try {
m ... | 1 |
[CLS] public void retrieveChallenges(int num) throws MalformedURLException, IOException, FBErrorException, FBConnectionException {
if (num < 1 || num > 100) {
error = true;
FBErrorException fbee = new FBErrorException();
fbee.setErrorCode(-100);
fbee.setErrorText(... | 0 |
[CLS] @SuppressWarnings("unchecked")
protected void processTransformAction(HttpServletRequest request, HttpServletResponse response, String action) throws Exception {
File transformationFile = null;
String tr = request.getParameter(Definitions.REQUEST_PARAMNAME_XSLT);
if (StringUtils.isNotBl... | 1 |
[CLS] String openUrlAsString(String address, int maxLines) {
StringBuffer sb;
try {
URL url = new URL(address);
InputStream in = url.openStream();
BufferedReader br = new BufferedReader(new InputStreamReader(in));
sb = new StringBuffer();
int c... | 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] @SuppressWarnings("unchecked")
@Override
public synchronized void drop(DropTargetDropEvent arg0) {
Helper.log().debug("Dropped");
Transferable t = arg0.getTransferable();
try {
arg0.acceptDrop(arg0.getDropAction());
List<File> filelist = (List<File>) t.getTr... | 0 |
[CLS] public void upload(String ftpServer, String user, String password, String fileName, File source) throws MalformedURLException, IOException {
if (ftpServer != null && fileName != null && source != null) {
StringBuffer sb = new StringBuffer("ftp://");
if (user != null && password != ... | 0 |
[CLS] public static Checksum checksum(File file, Checksum checksum) throws IOException {
if (file.isDirectory()) {
throw new IllegalArgumentException("Checksums can't be computed on directories");
}
InputStream in = null;
try {
in = new CheckedInputStream(new File... | 0 |
[CLS] public void testReaderWriterUC2() throws Exception {
String inFile = "test_data/mri.png";
String outFile = "test_output/mri__smooth_testReaderWriter.png";
itkImageFileReaderUC2_Pointer reader = itkImageFileReaderUC2.itkImageFileReaderUC2_New();
itkImageFileWriterUC2_Pointer writer ... | 0 |
[CLS] private String getData(String myurl) throws Exception {
URL url = new URL(myurl);
uc = (HttpURLConnection) url.openConnection();
br = new BufferedReader(new InputStreamReader(uc.getInputStream()));
String temp = "", k = "";
while ((temp = br.readLine()) != null) {
... | 1 |
[CLS] public static String getAnalysisServletOutput(String inputXml) {
java.io.BufferedWriter bWriter = null;
URLConnection connection = null;
String resultString = "";
bWriter = null;
connection = null;
String target = ServletConstant.ANALYSIS_SERVLET;
String mes... | 1 |
[CLS] public static String encrypt(String input) {
try {
MessageDigest md = MessageDigest.getInstance("SHA1");
md.update(input.getBytes("UTF-8"));
return toHexString(md.digest());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch ... | 1 |
[CLS] private static <OS extends OutputStream> OS getUnzipAndDecodeOutputStream(InputStream inputStream, final OS outputStream) {
final PipedOutputStream pipedOutputStream = new PipedOutputStream();
final List<Throwable> ungzipThreadThrowableList = new LinkedList<Throwable>();
Writer decoderWrit... | 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] public void run() {
long starttime = (new Date()).getTime();
Matcher m = Pattern.compile("(\\S+);(\\d+)").matcher(Destination);
boolean completed = false;
if (OutFile.length() > IncommingProcessor.MaxPayload) {
logger.warn("Payload is too large!");
close();
... | 1 |
[CLS] private final long test(final boolean applyFilter, final int executionCount) throws NoSuchAlgorithmException, NoSuchPaddingException, FileNotFoundException, IOException, RuleLoadingException {
final boolean stripHtmlEnabled = true;
final boolean injectSecretTokensEnabled = true;
final bool... | 1 |
[CLS] public void zipDocsetFiles(SaxHandler theXmlHandler, int theEventId, Attributes theAtts) throws BpsProcessException {
ZipOutputStream myZipOut = null;
BufferedInputStream myDocumentInputStream = null;
String myFinalFile = null;
String myTargetPath = null;
String myTargetFil... | 0 |
[CLS] public static byte[] ComputeForBinary(String ThisString) throws Exception {
byte[] Result;
MessageDigest MD5Hasher;
MD5Hasher = MessageDigest.getInstance("MD5");
MD5Hasher.update(ThisString.getBytes("iso-8859-1"));
Result = MD5Hasher.digest();
return Result;
} [... | 0 |
[CLS] public static String getInstanceUserdata() throws IOException {
int retries = 0;
while (true) {
try {
URL url = new URL("http://169.254.169.254/latest/user-data/");
InputStreamReader rdr = new InputStreamReader(url.openStream());
StringWr... | 1 |
[CLS] public void signAndSend() throws Exception {
SSLContext sslContext = null;
try {
sslContext = SSLContext.getInstance("TLS");
X509TrustManager[] xtmArray = new X509TrustManager[] { xtm };
sslContext.init(null, xtmArray, new java.security.SecureRandom());
... | 0 |
[CLS] protected void updateJava2ScriptProject(String prjFolder, String binRelative) {
try {
File cpFile = new File(prjFolder, ".classpath");
FileInputStream fis = new FileInputStream(cpFile);
String classpath = J2SLaunchingUtil.readAFile(fis);
if (classpath != nul... | 1 |
[CLS] @SuppressWarnings("deprecation")
public static final ReturnCode runCommand(IOBundle io, String[] args) {
if ((args.length < 3) || (args.length > 4)) return ReturnCode.makeReturnCode(ReturnCode.RET_INVALID_NUM_ARGS, "Invalid number of arguments: " + args.length);
if ((args.length == 3) && (!arg... | 1 |
[CLS] @Override
public TDSScene loadScene(URL url) throws IOException, IncorrectFormatException, ParsingErrorException {
boolean baseURLWasNull = setBaseURLFromModelURL(url);
TDSScene scene = loadScene(url.openStream());
if (baseURLWasNull) {
popBaseURL();
}
retur... | 0 |
[CLS] static Object executeMethod(HttpMethod method, int timeout, boolean array) throws HttpRequestFailureException, HttpException, IOException, HttpRequestTimeoutException {
try {
method.getParams().setSoTimeout(timeout * 1000);
int status = -1;
Object result = null;
... | 1 |
[CLS] private void getViolationsReportByProductOfferIdYearMonthDay() throws IOException {
String xmlFile9Send = System.getenv("SLASOI_HOME") + System.getProperty("file.separator") + "Integration" + System.getProperty("file.separator") + "soap" + System.getProperty("file.separator") + "getViolationsReportByProdu... | 0 |
[CLS] @Override
public void save(File folder) {
actInstance = instance;
this.setProperty(EsomMapper.PROPERTY_INSTANCE, String.valueOf(actInstance));
log.debug("instance: " + this.getProperty(EsomMapper.PROPERTY_INSTANCE));
if (this.getProperty(EsomMapper.PROPERTY_LRN_RADIO_SELECTED) ... | 1 |
[CLS] private static String webService(String strUrl) {
StringBuffer buffer = new StringBuffer();
try {
URL url = new URL(strUrl);
InputStream input = url.openStream();
String sCurrentLine = "";
InputStreamReader read = new InputStreamReader(input, "utf-8"... | 0 |
[CLS] public ActualTask(TEditor editor, TIGDataBase dataBase, String directoryPath) {
File myDirectory = new File(directoryPath);
String[] list = myDirectory.list();
int i;
for (i = 0; ((i < list.length) && !stop); i++) {
current = i;
if ((... | 0 |
[CLS] public void sendContent(OutputStream out, Range range, Map map, String string) throws IOException, NotAuthorizedException, BadRequestException {
System.out.println("sendContent " + file);
RFileInputStream in = new RFileInputStream(file);
try {
IOUtils.copyLarge(in, out);
... | 1 |
[CLS] public MapInfo getMap(double latitude, double longitude, double wanted_mapblast_scale, int image_width, int image_height, String file_path_wo_extension, ProgressListener progress_listener) throws IOException {
try {
double mapserver_scale = getDownloadScale(wanted_mapblast_scale);
... | 0 |
[CLS] public void rename(String virtualWiki, String oldTopicName, String newTopicName) throws Exception {
Connection conn = DatabaseConnection.getConnection();
try {
boolean commit = false;
conn.setAutoCommit(false);
try {
PreparedStatement pstm = conn... | 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 String digest(String password) {
try {
byte[] digest;
synchronized (__md5Lock) {
if (__md == null) {
try {
__md = MessageDigest.getInstance("MD5");
} catch (Exc... | 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... | 0 |
[CLS] public void testAddFiles() throws Exception {
File original = ZipPlugin.getFileInPlugin(new Path("testresources/test.zip"));
File copy = new File(original.getParentFile(), "1test.zip");
InputStream in = null;
OutputStream out = null;
try {
in = new FileInputStre... | 1 |
[CLS] public static ByteBuffer readURL(URL url) throws IOException, MalformedURLException {
URLConnection connection = null;
try {
connection = url.openConnection();
return readInputStream(new BufferedInputStream(connection.getInputStream()));
} catch (IOException e) {
... | 0 |
[CLS] @Deprecated
public static void getAndProcessContents(String videoPageURL, int bufsize, String charset, Closure<String> process) throws IOException {
URL url = null;
HttpURLConnection connection = null;
InputStream is = null;
InputStreamReader isr = null;
BufferedReader ... | 0 |
[CLS] private static void copyFile(String src, String dst) throws InvocationTargetException {
try {
FileChannel srcChannel;
srcChannel = new FileInputStream(src).getChannel();
FileChannel dstChannel = new FileOutputStream(dst).getChannel();
dstChannel.transferFrom... | 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... | 0 |
[CLS] private synchronized void configure() {
final Map res = new HashMap();
try {
final Enumeration resources = getConfigResources();
SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
while (resources.hasMoreElements()) {
final URL ... | 0 |
[CLS] public final String hashRealmPassword(String username, String realm, String password) throws GeneralSecurityException {
MessageDigest md = null;
md = MessageDigest.getInstance("MD5");
md.update(username.getBytes());
md.update(":".getBytes());
md.update(r... | 1 |
[CLS] private void sendFile(File file, HttpExchange response) throws IOException {
response.getResponseHeaders().add(FileUploadBase.CONTENT_LENGTH, Long.toString(file.length()));
InputStream inputStream = null;
try {
inputStream = new FileInputStream(file);
IOUtils.copy(i... | 0 |
[CLS] protected String getLibJSCode() throws IOException {
if (cachedLibJSCode == null) {
InputStream is = getClass().getResourceAsStream(JS_LIB_FILE);
StringWriter output = new StringWriter();
IOUtils.copy(is, output);
cachedLibJSCode = output.toString();
... | 1 |
[CLS] private void sendMessages() {
Configuration conf = Configuration.getInstance();
for (int i = 0; i < errors.size(); i++) {
String msg = null;
synchronized (this) {
msg = errors.get(i);
if (DEBUG) System.out.println(msg);
errors... | 0 |
[CLS] public static byte[] decrypt(byte[] ciphertext, byte[] key) throws IOException {
CryptInputStream in = new CryptInputStream(new ByteArrayInputStream(ciphertext), new SerpentEngine(), key);
ByteArrayOutputStream bout = new ByteArrayOutputStream();
IOUtils.copy(in, bout);
return bout... | 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] @Override
public void loadData() {
try {
String url = "http://ichart.finance.yahoo.com/table.csv?s=" + symbol + "&a=00&b=2&c=1962&d=11&e=11&f=2099&g=d&ignore=.csv";
URLConnection conn = (new URL(url)).openConnection();
conn.connect();
BufferedReader in =... | 0 |
[CLS] public MapInfo getMap(double latitude, double longitude, double wanted_mapblast_scale, int image_width, int image_height, String file_path_wo_extension, ProgressListener progress_listener) throws IOException {
try {
double mapserver_scale = getDownloadScale(wanted_mapblast_scale);
... | 0 |
[CLS] static String fetchURLComposeExternPackageList(String urlpath, String pkglisturlpath) {
String link = pkglisturlpath + "package-list";
try {
boolean relative = isRelativePath(urlpath);
readPackageList((new URL(link)).openStream(), urlpath, relative);
} catch (Malfor... | 0 |
[CLS] public String storeUploadedZip(byte[] zip, String name) {
List filesToStore = new ArrayList();
int i = 0;
ZipInputStream zipIs = new ZipInputStream(new ByteArrayInputStream(zip));
ZipEntry zipEntry = zipIs.getNextEntry();
while (zipEntry != null) {
if (zipEntry.... | 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 =... | 0 |
[CLS] public static OMElement createOMRequest(String file, int count, String[] documentIds) throws Exception {
ObjectFactory factory = new ObjectFactory();
SubmitDocumentRequest sdr = factory.createSubmitDocumentRequest();
IdType pid = factory.createIdType();
pid.setRoot("1.3.6.1.4.1.213... | 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 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] public static String encodeString(String encodeType, String str) {
if (encodeType.equals("md5of16")) {
MD5 m = new MD5();
return m.getMD5ofStr16(str);
} else if (encodeType.equals("md5of32")) {
MD5 m = new MD5();
return m.getMD5ofStr(str);
} ... | 0 |
[CLS] public static void copyFile(File in, File out, boolean append) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out, append).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel)... | 1 |
[CLS] public ActionForward dbExecute(ActionMapping pMapping, ActionForm pForm, HttpServletRequest pRequest, HttpServletResponse pResponse) throws DatabaseException {
Integer key;
SubmitUserForm form = (SubmitUserForm) pForm;
if (pRequest.getParameter("key") == null) {
key = form.getP... | 0 |
[CLS] public static String get_content(String _url) throws Exception {
URL url = new URL(_url);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
String content = new String();
while ((inputLine = in.readLine()) != null) {
... | 0 |
[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 sendGetRequest(String endpoint, String requestParameters) {
String result = null;
if (endpoint.startsWith("http://")) {
try {
System.setProperty("java.net.useSystemProxies", "true");
String urlStr = endpoint;
if (requ... | 0 |
[CLS] public byte[] loadClassFirst(final String className) {
if (className.equals("com.sun.sgs.impl.kernel.KernelContext")) {
final URL url = Thread.currentThread().getContextClassLoader().getResource("com/sun/sgs/impl/kernel/KernelContext.0.9.7.class.bin");
if (url != null) {
... | 0 |
[CLS] private static synchronized InputStream tryFailoverServer(String url, String currentlyActiveServer, int status, IOException e) throws MalformedURLException, IOException {
logger.log(Level.WARNING, "problems connecting to geonames server " + currentlyActiveServer, e);
if (geoNamesServerFailover == ... | 0 |
[CLS] public static String encodePassword(String password) {
try {
MessageDigest messageDiegest = MessageDigest.getInstance("SHA-1");
messageDiegest.update(password.getBytes("UTF-8"));
return Base64.encodeToString(messageDiegest.digest(), false);
} catch (NoSuchAlgori... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.