text string | label int64 |
|---|---|
[CLS] public void myCheckCredHandler(View v) {
Log.d("login_section", "entered handler");
EditText Username = (EditText) findViewById(R.id.Username);
EditText Password = (EditText) findViewById(R.id.user_pass);
String username_S = Username.getText().toString();
String pass_S = Pa... | 0 |
[CLS] private HttpURLConnection connect() throws MalformedURLException, IOException {
HttpURLConnection connection = null;
if (repositoryLocation == null) {
Utils.debug("RemoteRepository", "repository Location unspecified");
return null;
}
URL url = new URL(reposi... | 0 |
[CLS] private void doIt() throws Throwable {
int numCachedTiles = 0;
try {
List<MapTile> backTiles = new ArrayList<MapTile>();
final LatLngRectangle bounds = new LatLngRectangle(new LatLngPoint(south, west), new LatLngPoint(north, east));
final String backMapGuid = "g... | 1 |
[CLS] protected void removeMessage(ReplicationMessage message) {
logger.info(String.format("remove replication message: %d", message.getId()));
ConnectionProvider cp = null;
Connection conn = null;
PreparedStatement ps = null;
try {
SessionFactoryImplementor impl = (S... | 0 |
[CLS] private void getRandomGUID(boolean secure) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer(128);
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
}
try {
long time = System.curr... | 1 |
[CLS] public Main(String[] args) {
boolean encrypt = false;
if (args[0].compareTo("-e") == 0) {
encrypt = true;
} else if (args[0].compareTo("-d") == 0) {
encrypt = false;
} else {
System.out.println("first argument is invalid");
System.exi... | 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 BufferedWriter createOutputStream(String inFile, String outFile) throws IOException {
int k_blockSize = 1024;
int byteCount;
char[] buf = new char[k_blockSize];
File ofp = new File(outFile);
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(ofp));
... | 1 |
[CLS] public static File copyFile(File srcFile, File destFolder, FileCopyListener copyListener) {
File dest = new File(destFolder, srcFile.getName());
try {
FileInputStream in = new FileInputStream(srcFile);
FileOutputStream out = new FileOutputStream(dest);
byte[] re... | 1 |
[CLS] public static void transfer(File src, File dest, boolean removeSrc) throws FileNotFoundException, IOException {
Log.warning("source: " + src);
Log.warning("dest: " + dest);
if (!src.canRead()) {
throw new IOException("can not read src file: " + src);
}
if (!dest... | 0 |
[CLS] private boolean importPKC(String keystoreLocation, String pw, String pkcFile, String alias) {
boolean imported = false;
KeyStore ks = null;
try {
ks = KeyStore.getInstance(KeyStore.getDefaultType());
ks.load(new BufferedInputStream(new FileInputStream(keystoreLocati... | 1 |
[CLS] public static Bitmap loadBitmap(String url) {
try {
final HttpClient httpClient = getHttpClient();
final HttpResponse resp = httpClient.execute(new HttpGet(url));
final HttpEntity entity = resp.getEntity();
final int statusCode = resp.getStatusLine().getStat... | 0 |
[CLS] public static void copy(File inputFile, File target) throws IOException {
if (!inputFile.exists()) return;
OutputStream output = new FileOutputStream(target);
InputStream input = new BufferedInputStream(new FileInputStream(inputFile));
int b;
while ((b = input.read()) != -1... | 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.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 1 |
[CLS] public static boolean changeCredentials() {
boolean passed = false;
boolean credentials = false;
HashMap info = null;
Debug.log("Main.changeCredentials", "show dialog for userinfo");
info = getUserInfo();
if ((Boolean) info.get("submit")) {
try {
... | 1 |
[CLS] public static void zipDirectory(String dir, String zipfile) throws IOException, IllegalArgumentException {
File d = new File(dir);
if (!d.isDirectory()) throw new IllegalArgumentException("Not a directory: " + dir);
String[] entries = d.list();
byte[] buffer = new byte[4096];
... | 0 |
[CLS] @Test
public void testCopy_readerToOutputStream_nullOut() throws Exception {
InputStream in = new ByteArrayInputStream(inData);
in = new YellOnCloseInputStreamTest(in);
Reader reader = new InputStreamReader(in, "US-ASCII");
try {
IOUtils.copy(reader, (OutputStream) ... | 1 |
[CLS] public String getSummaryText() {
if (summaryText == null) {
for (Iterator iter = xdcSources.values().iterator(); iter.hasNext(); ) {
XdcSource source = (XdcSource) iter.next();
File packageFile = new File(source.getFile().getParentFile(), "xdc-package.html");
... | 1 |
[CLS] private void runGetVendorProfile() {
DataStorage.clearVendorProfile();
GenericUrl url = new GoogleUrl(EnterpriseMarketplaceUrl.generateVendorProfileUrl());
VendorProfile vendorProfile = null;
try {
HttpRequest request = requestFactory.buildGetRequest(url);
r... | 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] private void createHomeTab() {
Tabpanel homeTab = new Tabpanel();
windowContainer.addWindow(homeTab, Msg.getMsg(EnvWeb.getCtx(), "Home").replaceAll("&", ""), false);
Portallayout portalLayout = new Portallayout();
portalLayout.setWidth("100%");
portalLayout.setHeight("100%"... | 0 |
[CLS] private void generate(String salt) {
MessageDigest md5 = null;
StringBuffer sbValueBeforeMD5 = new StringBuffer();
try {
md5 = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
logger.error("No MD5", e);
}
long time = S... | 0 |
[CLS] @Override
public LispObject execute(LispObject first, LispObject second) throws ConditionThrowable {
Pathname zipfilePathname = coerceToPathname(first);
byte[] buffer = new byte[4096];
try {
String zipfileNamestring = zipfilePathname.getNamestring();
if (zipfile... | 1 |
[CLS] public void includeCss(Group group, Writer out, PageContext pageContext) throws IOException {
ByteArrayOutputStream outtmp = new ByteArrayOutputStream();
if (AbstractGroupBuilder.getInstance().buildGroupJsIfNeeded(group, outtmp, pageContext.getServletContext())) {
FileOutputStream file... | 1 |
[CLS] private void copyFile(String fileName, String messageID, boolean isError) {
try {
File inputFile = new File(fileName);
File outputFile = null;
if (isError) {
outputFile = new File(provider.getErrorDataLocation(folderName) + messageID + ".xml");
... | 1 |
[CLS] public static void copyFile(File file, String destDir) throws IOException {
if (!isCanReadFile(file)) throw new RuntimeException("The File can't read:" + file.getPath());
if (!isCanWriteDirectory(destDir)) throw new RuntimeException("The Directory can't write:" + destDir);
FileChannel srcC... | 1 |
[CLS] public static Reader createReader(TreeLogger logger, URL url) throws UnableToCompleteException {
try {
return new InputStreamReader(url.openStream());
} catch (IOException e) {
logger.log(TreeLogger.ERROR, "Unable to open resource: " + url, e);
throw new UnableT... | 0 |
[CLS] @Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, final HttpServletResponse response) throws Exception {
final String id = request.getParameter("id");
if (id == null) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return null;... | 1 |
[CLS] public void execute() {
checkInput();
try {
client = new FTPClient();
log("Connecting to " + ftpServer, Project.MSG_INFO);
client.connect(ftpServer, ftpPort);
checkFtpCode(client, "FTP server refused connection:");
log("Connected", Projec... | 0 |
[CLS] public static String hash(String value) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance(HASH_ALGORITHM);
} catch (NoSuchAlgorithmException e) {
throw new CryptoException(e);
}
try {
md.update(value.getBytes(INPUT_ENCODING)... | 0 |
[CLS] protected void copyFile(String from, String to, String workingDirectory) throws Exception {
URL monitorCallShellScriptUrl = Thread.currentThread().getContextClassLoader().getResource(from);
File f = new File(monitorCallShellScriptUrl.getFile());
String directoryPath = f.getAbsolutePath();
... | 1 |
[CLS] public static void proxyRequest(IPageContext context, Writer writer, String proxyPath) throws IOException {
URLConnection connection = new URL(proxyPath).openConnection();
connection.setDoInput(true);
connection.setDoOutput(false);
connection.setUseCaches(false);
connection... | 1 |
[CLS] public static void copyFile(String source, String dest) throws IOException {
FileChannel in = null, out = null;
try {
in = new FileInputStream(new File(source)).getChannel();
out = new FileOutputStream(new File(dest)).getChannel();
in.transferTo(0, in.size(), ou... | 1 |
[CLS] public static String getHashedPasswordTc(String password) throws java.security.NoSuchAlgorithmException {
java.security.MessageDigest d = java.security.MessageDigest.getInstance("MD5");
d.reset();
d.update(password.getBytes());
byte[] buf = d.digest();
char[] cbf = new char... | 0 |
[CLS] public static void copyFile(File sourceFile, File destFile) throws IOException {
log.info("Copying file '" + sourceFile + "' to '" + destFile + "'");
if (!sourceFile.isFile()) {
throw new IllegalArgumentException("The sourceFile '" + sourceFile + "' does not exist or is not a normal fi... | 1 |
[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);
... | 0 |
[CLS] void acessResource(ClassLoader cl, String resource) throws IOException {
URL url = cl.getResource(resource);
if (url == null) {
println("Ups can't find resource " + resource);
} else {
println("URL OK " + resource + " ->" + url);
InputStream is = url.ope... | 0 |
[CLS] private void findFile() throws SchedulerException {
java.io.InputStream f = null;
String furl = null;
File file = new File(getFileName());
if (!file.exists()) {
URL url = classLoadHelper.getResource(getFileName());
if (url != null) {
try {
... | 0 |
[CLS] public String sendRequestHTTPTunelling(java.lang.String servletName, java.lang.String request) {
String reqxml = "";
org.jdom.Document retdoc = null;
String myurl = java.util.prefs.Preferences.systemRoot().get("serverurl", "");
String myport = java.util.prefs.Preferences.systemRoot... | 0 |
[CLS] private void openConnection() throws IOException {
connection = (HttpURLConnection) url.openConnection(Global.getProxy());
connection.setDoInput(true);
connection.setDoOutput(true);
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type", "text/xml... | 0 |
[CLS] protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String servletPath = req.getServletPath();
String requestURI = req.getRequestURI();
String resource = requestURI.substring(requestURI.indexOf(servletPath) + servletPath.length());
... | 0 |
[CLS] protected void find(final String pckgname, final boolean recursive) {
URL url;
String name = pckgname;
name = name.replace('.', '/');
url = ResourceLocatorTool.getClassPathResource(ExampleRunner.class, name);
File directory;
try {
... | 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] @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
if (req.getParameter("i") != null) {
String img = req.getParameter("i");
if (img == null) {
resp.sendError(404, "Image was null");
... | 0 |
[CLS] private static void backupFile(File file) {
FileChannel in = null, out = null;
try {
if (!file.getName().endsWith(".bak")) {
in = new FileInputStream(file).getChannel();
out = new FileOutputStream(new File(file.toString() + ".bak")).getChannel();
... | 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 List importSymbols(List symbols) throws ImportExportException {
List quotes = new ArrayList();
String URLString = constructURL(symbols);
IDQuoteFilter filter = new YahooIDQuoteFilter();
PreferencesManager.ProxyPreferences proxyPreferences = PreferencesManager.loadProx... | 0 |
[CLS] public ActionResponse executeAction(ActionRequest request) throws Exception {
BufferedReader in = null;
try {
CurrencyEntityManager em = new CurrencyEntityManager();
String id = (String) request.getProperty("ID");
CurrencyMonitor cm = getCurrencyMonitor(em, Long... | 0 |
[CLS] public void testDigest() {
try {
String myinfo = "我的测试信息";
MessageDigest alga = MessageDigest.getInstance("SHA-1");
alga.update(myinfo.getBytes());
byte[] digesta = alga.digest();
System.out.println("本信息摘要是:" + byte2hex(digesta));
Mes... | 1 |
[CLS] private static FTPClient getFtpClient(String ftpHost, String ftpUsername, String ftpPassword) throws SocketException, IOException {
FTPClient ftp = new FTPClient();
ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));
ftp.connect(ftpHost);
int repl... | 0 |
[CLS] public String MD5(String text) {
try {
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5hash = new byte[32];
md.update(text.getBytes("iso-8859-1"), 0, text.length());
md5hash = md.digest();
return convertToHex(md5has... | 0 |
[CLS] @Override
public void sendData(String serverUrl, String fileName, String type, InputStream is) throws IOException {
ClientSession clientSession = null;
try {
if (logger.isDebugEnabled()) {
logger.debug("Connecting to " + serverUrl);
}
clientS... | 1 |
[CLS] private void impurlActionPerformed(java.awt.event.ActionEvent evt) {
try {
String prevurl = Prefs.getPref(PrefName.LASTIMPURL);
String urlst = JOptionPane.showInputDialog(Resource.getResourceString("enturl"), prevurl);
if (urlst == null || urlst.equals("")) return;
... | 0 |
[CLS] public String generateMappackMD5(File mapPackFile) throws IOException, NoSuchAlgorithmException {
ZipFile zip = new ZipFile(mapPackFile);
try {
Enumeration<? extends ZipEntry> entries = zip.entries();
MessageDigest md5Total = MessageDigest.getInstance("MD5");
Me... | 1 |
[CLS] public AudioFileFormat getAudioFileFormat(URL url) throws UnsupportedAudioFileException, IOException {
InputStream stream = url.openStream();
AudioFileFormat format;
try {
format = getAudioFileFormat(new BufferedInputStream(stream));
} finally {
stream.close... | 0 |
[CLS] private void downloadPage(final URL url, final File file) {
try {
long size = 0;
final byte[] buffer = new byte[BotUtil.BUFFER_SIZE];
final File tempFile = new File(file.getParentFile(), "temp.tmp");
int length;
int lastUpdate = 0;
Fi... | 0 |
[CLS] private static byte[] calcMd5(String pass) {
try {
MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
digest.update(pass.getBytes(), 0, pass.length());
byte[] hash = digest.digest();
return hash;
} catch (NoSuchAlgorithmException ... | 0 |
[CLS] public static void writeEntry(File file, File input) throws PersistenceException {
try {
File temporaryFile = File.createTempFile("pmMDA_zargo", ARGOUML_EXT);
temporaryFile.deleteOnExit();
ZipOutputStream output = new ZipOutputStream(new FileOutputStream(temporaryFile))... | 0 |
[CLS] public GetMyDocuments() {
String urlString = dms_url + "/servlet/com.ufnasoft.dms.server.ServerGetMyDocuments";
String rvalue = "";
String filename = dms_home + FS + "temp" + FS + username + "mydocuments.xml";
try {
String urldata = urlString + "?username=" + URLEncoder... | 0 |
[CLS] @Override
public void handlePeerEvent(PeerEvent event) {
if (event.geteventInfo() instanceof EventServiceInfo) {
EventServiceInfo info = (EventServiceInfo) event.geteventInfo();
if (info.getServiceState() != ServiceState.Deployed) return;
long bid = info.getBundleId... | 0 |
[CLS] private void handleServerIntroduction(DataPacket serverPacket) {
DataPacketIterator iter = serverPacket.getDataPacketIterator();
String version = iter.nextString();
int serverReportedUDPPort = iter.nextUByte2();
_authKey = iter.nextUByte4();
_introKey = iter.nextUByte4();
... | 1 |
[CLS] private void initLogging() {
File logging = new File(App.getHome(), "logging.properties");
if (!logging.exists()) {
InputStream input = getClass().getResourceAsStream("logging.properties-setup");
OutputStream output = null;
try {
output = new Fil... | 0 |
[CLS] private void processRequest(HttpServletRequest request, HttpServletResponse response) throws IOException {
response.setContentType("text/html");
ServletContext ctx = getServletContext();
RequestDispatcher rd = ctx.getRequestDispatcher(SETUP_JSP);
HttpSession session = request.getSe... | 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 reademi(Vector<String> descriptions, Vector<String> links, String linkaddress, String idmap) {
InputStream is = null;
URL url;
ArrayList<String> keys = new ArrayList<String>();
ArrayList<String> names = new ArrayList<String>();
try {
url = new URL(id... | 0 |
[CLS] protected void unZip() throws PersistenceException {
boolean newZip = false;
try {
if (null == backup) {
mode = (String) context.get(Context.MODE);
if (null == mode) mode = Context.MODE_NAME_RESTORE;
backupDirectory = (File) context.get(C... | 1 |
[CLS] public static boolean copyMerge(FileSystem srcFS, Path srcDir, FileSystem dstFS, Path dstFile, boolean deleteSource, Configuration conf, String addString) throws IOException {
dstFile = checkDest(srcDir.getName(), dstFS, dstFile, false);
if (!srcFS.getFileStatus(srcDir).isDir()) return false;
... | 1 |
[CLS] public ServiceAdapterIfc deploy(String session, String name, byte jarBytes[], String jarName, String serviceClass, String serviceInterface) throws RemoteException, MalformedURLException, StartServiceException, SessionException {
try {
File jarFile = new File(jarName);
jarName = jar... | 1 |
[CLS] private static void backupFile(File file) {
FileChannel in = null, out = null;
try {
if (!file.getName().endsWith(".bak")) {
in = new FileInputStream(file).getChannel();
out = new FileOutputStream(new File(file.toString() + ".bak")).getChannel();
... | 1 |
[CLS] public static void main(String[] args) throws IOException {
String uri = "hdfs://localhost:8020/user/leeing/maxtemp/sample.txt";
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(URI.create(uri), conf);
InputStream in = null;
try {
in = fs... | 1 |
[CLS] public void writeConfigurationFile() throws IOException, ComponentException {
SystemConfig config = parent.getParentSystem().getConfiguration();
File original = config.getLocation();
File backup = new File(original.getParentFile(), original.getName() + "." + System.currentTimeMillis());
... | 1 |
[CLS] private String getMD5(String password) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(password.getBytes());
byte[] data = md.digest();
return convertToHex(data);
} catch (Exception ex) {
ex.printStackTrace();
... | 1 |
[CLS] public boolean copy(String file, String path) {
try {
File file_in = new File(file);
String tmp1, tmp2;
tmp1 = file;
tmp2 = path;
while (tmp2.contains("\\")) {
tmp2 = tmp2.substring(tmp2.indexOf("\\") + 1);
tmp1 = ... | 1 |
[CLS] public static String generateHash(String string, String algoritmo) {
try {
MessageDigest md = MessageDigest.getInstance(algoritmo);
md.update(string.getBytes());
byte[] result = md.digest();
int firstPart;
int lastPart;
StringBuilder ... | 1 |
[CLS] private ScrollingGraphicalViewer createGraphicalViewer(final Composite parent) {
final ScrollingGraphicalViewer viewer = new ScrollingGraphicalViewer();
viewer.createControl(parent);
_root = new EditRootEditPart();
viewer.setRootEditPart(_root);
getEditDomain().addViewer(vi... | 0 |
[CLS] private void announce(String trackerURL, byte[] hash, byte[] peerId, int port) {
try {
String strUrl = trackerURL + "?info_hash=" + URLEncoder.encode(new String(hash, Constants.BYTE_ENCODING), Constants.BYTE_ENCODING).replaceAll("\\+", "%20") + "&peer_id=" + URLEncoder.encode(new String(peerId... | 0 |
[CLS] @Algorithm(name = "EXT")
public void execute() {
Connection conn = null;
try {
Class.forName(jdbcDriver).newInstance();
conn = DriverManager.getConnection(jdbcUrl, username, password);
conn.setAutoCommit(false);
l.debug("Connected to the database... | 0 |
[CLS] public String readFile(String filename) throws IOException {
FTPClient ftpClient = new FTPClient();
ftpClient.connect(server, port);
ftpClient.login(USERNAME, PASSWORD);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
boolean success = ftpClient.retrieveFi... | 0 |
[CLS] public static boolean copyDataToNewTable(EboContext p_eboctx, String srcTableName, String destTableName, String where, boolean log, int mode) throws boRuntimeException {
srcTableName = srcTableName.toUpperCase();
destTableName = destTableName.toUpperCase();
Connection cn = null;
Co... | 0 |
[CLS] public void copyFile(String oldPathFile, String newPathFile) {
try {
int bytesum = 0;
int byteread = 0;
File oldfile = new File(oldPathFile);
if (oldfile.exists()) {
InputStream inStream = new FileInputStream(oldPathFile);
Fil... | 1 |
[CLS] private String SHA1(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash = new byte[40];
md.update(text.getBytes("iso-8859-1"), 0, text.length());
sha1hash = md.digest();
... | 0 |
[CLS] public static NSImage getImage(URL url) {
InputStream in = null;
try {
in = url.openStream();
} catch (IOException e) {
Log.error(e.getMessage(), e);
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buff = new byte[10 * 1024]... | 0 |
[CLS] public String getSHA1(String input) {
byte[] output = null;
try {
MessageDigest md = MessageDigest.getInstance("SHA1");
md.update(input.getBytes());
output = md.digest();
} catch (Exception e) {
System.out.println("Exception: " + e);
... | 0 |
[CLS] public Writer createWriter(File outfile, String encoding) throws UnsupportedEncodingException, IOException {
int k_blockSize = 1024;
int byteCount;
char[] buf = new char[k_blockSize];
ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(outfile));
zos.setMethod(Zi... | 0 |
[CLS] public static String md5(String text) {
String hashed = "";
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.update(text.getBytes(), 0, text.length());
hashed = new BigInteger(1, digest.digest()).toString(16);
} catch (Exception e) {... | 0 |
[CLS] public void service(Request req, Response resp) {
PrintStream out = null;
try {
out = resp.getPrintStream(8192);
String env = req.getParameter("env");
String regex = req.getParameter("regex");
String deep = req.getParameter("deep");
Strin... | 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.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 1 |
[CLS] public void run() {
try {
ThreadGroup transfers = new ThreadGroup("transfers");
URL url = new URL("jar:http://jopenrpg.sourceforge.net/files/dev/pythonlib.jar!/");
JarURLConnection juc = (JarURLConnection) url.openConnection();
File top = new File(System.get... | 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 static String hashPassword(String password) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-512");
md.update(password.getBytes("UTF-8"));
byte[] bytes = md.digest();
String result = encodeBase64(bytes);
return result.trim();
... | 0 |
[CLS] public void resumereceive(HttpServletRequest req, HttpServletResponse resp, SessionCommand command) {
setHeader(resp);
try {
logger.debug("ResRec: Resume a 'receive' session with session id " + command.getSession() + " this client already received " + command.getLen() + " bytes");
... | 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 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] @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.addHeader("Cache-Control", "max-age=" + Constants.HTTP_CACHE_SECONDS);
String uuid = req.getRequestURI().substring(req.getRequestURI().indexOf(Constants.SERVLET_FULL_PRE... | 0 |
[CLS] public static void main(String[] args) {
try {
String completePath = null;
String predictionFileName = null;
if (args.length == 2) {
completePath = args[0];
predictionFileName = args[1];
} else {
System.out.pri... | 1 |
[CLS] @Override
public void actionPerformed(ActionEvent e) {
if (copiedFiles_ != null) {
File[] tmpFiles = new File[copiedFiles_.length];
File tmpDir = new File(Settings.getPropertyString(ConstantKeys.project_dir), "tmp/");
tmpDir.mkdirs();
... | 1 |
[CLS] public void updateRole(AuthSession authSession, RoleBean roleBean) {
DatabaseAdapter dbDyn = null;
PreparedStatement ps = null;
try {
dbDyn = DatabaseAdapter.getInstance();
String sql = "update WM_AUTH_ACCESS_GROUP " + "set NAME_ACCESS_GROUP=? " + "WHERE ID_ACCE... | 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 boolean copyFile(File inFile, File outFile) {
BufferedReader reader = null;
BufferedWriter writer = null;
try {
reader = new BufferedReader(new FileReader(inFile));
writer = new BufferedWriter(new FileWriter(outFile));
while (reader.ready()) {
... | 1 |
[CLS] @Override
public void setContentAsStream(InputStream input) throws IOException {
BufferedOutputStream output = new BufferedOutputStream(new FileOutputStream(htmlFile));
try {
IOUtils.copy(input, output);
} finally {
output.close();
}
if (this.get... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.