text string | label int64 |
|---|---|
[CLS] private String sha1(String s) {
String encrypt = s;
try {
MessageDigest sha = MessageDigest.getInstance("SHA-1");
sha.update(s.getBytes());
byte[] digest = sha.digest();
final StringBuffer buffer = new StringBuffer();
for (int i = 0; i < ... | 0 |
[CLS] public void run() {
try {
Socket socket = getSocket();
System.out.println("opening socket to " + address + " on " + port);
InputStream in = socket.getInputStream();
for (; ; ) {
FileTransferHeader header = FileTransferHeader.readHeader(in);
... | 1 |
[CLS] public static String encryptStringWithSHA2(String input) {
String output = null;
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
md.update(input.getBytes(... | 1 |
[CLS] public static void copy(File source, File dest) throws IOException {
FileChannel in = null, out = null;
try {
in = new FileInputStream(source).getChannel();
out = new FileOutputStream(dest).getChannel();
long size = in.size();
MappedByteBuffer buf = ... | 0 |
[CLS] private static final String getResult(String url, String postData) throws MalformedURLException, IOException {
HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection();
if (!postData.equals("null")) {
postData = postData.substring(1, postData.length() - 1);
... | 0 |
[CLS] @Override
public void run() {
try {
FileChannel in = new FileInputStream(inputfile).getChannel();
long pos = 0;
for (int i = 1; i <= noofparts; i++) {
FileChannel out = new FileOutputStream(outputfile.getAbsolutePath() + "." + "v" + i).getChannel();
... | 1 |
[CLS] public LocalizationSolver(String name, String serverIP, int portNum, String workDir) {
this.info = new HashMap<String, Object>();
this.workDir = workDir;
try {
Socket solverSocket = new Socket(serverIP, portNum);
this.fromServer = new Scanner(solverSocket.getInputSt... | 1 |
[CLS] public boolean downloadNextTLE() {
boolean success = true;
if (!downloadINI) {
errorText = "startTLEDownload() must be ran before downloadNextTLE() can begin";
return false;
}
if (!this.hasMoreToDownload()) {
errorText = "There are no more TLEs t... | 0 |
[CLS] public String getDataAsString(String url) throws RuntimeException {
try {
String responseBody = "";
URLConnection urlc;
if (!url.toUpperCase().startsWith("HTTP://") && !url.toUpperCase().startsWith("HTTPS://")) {
urlc = tryOpenConnection(url);
... | 0 |
[CLS] public static String calculateHA2(String uri) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(getBytes("GET", ISO_8859_1));
md.update((byte) ':');
md.update(getBytes(uri, ISO_8859_1));
return toHexString(md.digest());
... | 1 |
[CLS] private 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, outpu... | 1 |
[CLS] private Collection<Class<? extends Plugin>> loadFromResource(ClassLoader classLoader, String resource) throws IOException {
Collection<Class<? extends Plugin>> pluginClasses = new HashSet<Class<? extends Plugin>>();
Enumeration providerFiles = classLoader.getResources(resource);
if (!provi... | 0 |
[CLS] private byte[] streamToBytes(InputStream in) throws IOException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
IOUtils.copy(in, out);
} finally {
IOUtils.closeQuietly(in);
}
return out.toByteArray();
} [SEP] public static boolea... | 1 |
[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... | 1 |
[CLS] public static String getMd5(String str) {
try {
final MessageDigest md = MessageDigest.getInstance("MD5");
md.update(str.getBytes());
final byte b[] = md.digest();
int i;
final StringBuffer buf = new StringBuffer("");
for (int offset ... | 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] 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 saveFileFromURL(URL url, File destinationFile) throws IOException {
FileOutputStream fo = new FileOutputStream(destinationFile);
InputStream is = url.openStream();
byte[] data = new byte[1024];
int bytecount = 0;
do {
fo.write(data, 0, bytecou... | 0 |
[CLS] public static String digest(String algorithm, String text) {
MessageDigest mDigest = null;
try {
mDigest = MessageDigest.getInstance(algorithm);
mDigest.update(text.getBytes(ENCODING));
} catch (NoSuchAlgorithmException nsae) {
Logger.error(Encryptor.cla... | 0 |
[CLS] public static String hash(final String text) {
try {
MessageDigest md;
md = MessageDigest.getInstance("SHA-1");
byte[] sha1hash;
md.update(text.getBytes("iso-8859-1"), 0, text.length());
sha1hash = md.digest();
return Sha1.convertToHe... | 0 |
[CLS] private void setInlineXML(Entry entry, DatastreamXMLMetadata ds) throws UnsupportedEncodingException, StreamIOException {
String content;
if (m_obj.hasContentModel(Models.SERVICE_DEPLOYMENT_3_0) && (ds.DatastreamID.equals("SERVICE-PROFILE") || ds.DatastreamID.equals("WSDL"))) {
content... | 0 |
[CLS] private String save(UploadedFile imageFile) {
try {
File saveFld = new File(imageFolder + File.separator + userDisplay.getUser().getUsername());
if (!saveFld.exists()) {
if (!saveFld.mkdir()) {
logger.info("Unable to create folder: " + saveFld.ge... | 1 |
[CLS] public static void parseRDFXML(String url, StatementHandler handler) throws IOException {
ARP parser = new ARP();
parser.getHandlers().setStatementHandler(handler);
URLConnection conn = new URL(url).openConnection();
String encoding = conn.getContentEncoding();
InputStream ... | 0 |
[CLS] private static byte[] createHash(EHashType hashType, String string) {
MessageDigest md;
try {
md = MessageDigest.getInstance(hashType.getJavaHashType());
md.reset();
md.update(string.getBytes());
byte[] byteResult = md.digest();
return by... | 1 |
[CLS] public final void testT4CClientWriter() throws Exception {
InputStream is = ClassLoader.getSystemResourceAsStream(this.testFileName);
T4CClientReader reader = new T4CClientReader(is, rc);
File tmpFile = File.createTempFile("barde", ".log", this.tmpDir);
System.out.println("tmp=" + ... | 1 |
[CLS] public DataSet newparse() throws SnifflibDatatypeException {
NumberFormat numformat = NumberFormat.getInstance();
if (this.headers.size() != this.types.size()) {
throw new SnifflibDatatypeException("Different number of headers (" + this.headers.size() + ") and types(" + this.types.size... | 0 |
[CLS] public static void main(String[] args) {
String fe = null, fk = null, f1 = null, f2 = null;
DecimalFormat df = new DecimalFormat("000");
int key = 0;
int i = 1;
for (; ; ) {
System.out.println("===================================================");
S... | 1 |
[CLS] private void copyIntoFile(String resource, File output) throws IOException {
FileOutputStream out = null;
InputStream in = null;
try {
out = FileUtils.openOutputStream(output);
in = GroovyInstanceTest.class.getResourceAsStream(resource);
IOUtils.copy(in,... | 1 |
[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] private static void copierScriptChargement(File webInfDir, String initialDataChoice) {
File chargementInitialDir = new File(webInfDir, "chargementInitial");
File fichierChargement = new File(chargementInitialDir, "ScriptChargementInitial.sql");
File fichierChargementAll = new File(chargeme... | 0 |
[CLS] public static void copyFile(File source, File dest) throws IOException {
FileChannel in = null, out = null;
try {
in = new FileInputStream(source).getChannel();
out = new FileOutputStream(dest).getChannel();
in.transferTo(0, in.size(), out);
} catch (Exc... | 1 |
[CLS] @Override
public Scene load(URL url) throws FileNotFoundException, IncorrectFormatException, ParsingErrorException {
URL baseUrl = this.baseUrl;
if (this.baseUrl == null) {
baseUrl = url;
}
InputStream in;
try {
in = url.openStream();
} c... | 0 |
[CLS] void copyFile(String src, String dest) throws IOException {
int amount;
byte[] buffer = new byte[4096];
FileInputStream in = new FileInputStream(src);
FileOutputStream out = new FileOutputStream(dest);
while ((amount = in.read(buffer)) != -1) out.write(buffer, 0, amount);
... | 1 |
[CLS] public ActionForward uploadFile(ActionMapping mapping, ActionForm actForm, HttpServletRequest request, HttpServletResponse in_response) {
ActionMessages errors = new ActionMessages();
ActionMessages messages = new ActionMessages();
String returnPage = "submitPocketSampleInformationPage";
... | 1 |
[CLS] public static String sendRequest(String urlstring) {
URL url;
String line;
Log.i("DVBMonitor", "Please wait while receiving data from dvb...");
try {
url = new URL(urlstring);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
... | 0 |
[CLS] public static final synchronized String hash(String data) {
if (digest == null) {
try {
digest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException nsae) {
System.err.println("Failed to load the MD5 MessageDigest. " + "We will be una... | 1 |
[CLS] private Document saveFile(Document document, File file) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat(Constants.DATEFORMAT_YYYYMMDD);
List<Preference> preferences = prefService.findAll();
if (preferences != null && !preferences.isEmpty()) {
Preference preferenc... | 1 |
[CLS] public void testRenderRules() {
try {
MappingManager manager = new MappingManager();
OWLOntologyManager omanager = OWLManager.createOWLOntologyManager();
OWLOntology srcOntology;
OWLOntology targetOntology;
manager.loadMapping(rulesDoc.toURL());
... | 1 |
[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] private static void main(String[] args) {
try {
File f = new File("test.txt");
if (f.exists()) {
throw new IOException(f + " already exists. I don't want to overwrite it.");
}
StraightStreamReader in;
char[] cbuf = new char[0x100... | 1 |
[CLS] public static boolean copy(InputStream is, File file) {
try {
IOUtils.copy(is, new FileOutputStream(file));
return true;
} catch (Exception e) {
logger.severe(e.getMessage());
return false;
}
} [SEP] public static void copyFile(File sourc... | 1 |
[CLS] private static void unzipEntry(final ZipFile zipfile, final ZipEntry entry, final File outputDir) throws IOException {
if (entry.isDirectory()) {
createDir(new File(outputDir, entry.getName()));
return;
}
File outputFile = new File(outputDir, entry.getName());
... | 0 |
[CLS] @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.listview);
HttpGet request = new HttpGet(SERVICE_URI + "/json/getproducts");
request.setHeader("Accept", "application/json");
request.setHeader("Conte... | 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 postToAddress(Map<String, String> params, String address) throws Exception {
String data = "";
String separator = "";
for (String key : params.keySet()) {
data += separator + URLEncoder.encode(key, "UTF-8") + "=" + URLEncoder.encode(params.get(key), "UTF-8"... | 0 |
[CLS] private boolean copyFiles(File sourceDir, File destinationDir) {
boolean result = false;
try {
if (sourceDir != null && destinationDir != null && sourceDir.exists() && destinationDir.exists() && sourceDir.isDirectory() && destinationDir.isDirectory()) {
File sourceFiles... | 0 |
[CLS] private void duplicateIndices(Connection scon, Connection dcon, String table) {
try {
String idx_name, idx_att, query;
ResultSet idxs = scon.getMetaData().getIndexInfo(null, null, table, false, false);
Statement stmt = dcon.createStatement();
while (idxs.nex... | 1 |
[CLS] private static boolean tryExpandGorillaHome(File f) throws GorillaHomeException {
if (f.exists()) {
if (!f.isDirectory() || !f.canWrite()) {
return false;
}
} else {
boolean dirOK = f.mkdirs();
}
if (f.exists() && f.isDirectory() ... | 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 test_calculateLastModifiedSizeContent() {
File file;
String content = "Hello, world!";
String expected;
FileETag etag;
try {
file = File.createTempFile("temp", "txt");
file.deleteOnExit();
FileOutputStream out = new FileOutput... | 0 |
[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 String uploadReport(Collection c) {
try {
String id = generateRandomId();
Iterator iter = c.iterator();
URL url = new URL(ZorobotSystem.props.getProperty("zoro.url") + "auplo2.jsp");
URLConnection connection = url.openConnection();
connect... | 0 |
[CLS] public static String md5(String str) {
if (str == null) {
System.err.println("Stringx.md5 (String) : null string.");
return "";
}
String rt = "";
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.update(str.getBytes("gb2... | 1 |
[CLS] public void jsFunction_addFile(ScriptableFile infile) throws IOException {
if (!infile.jsFunction_exists()) throw new IllegalArgumentException("Cannot add a file that doesn't exists to an archive");
ZipArchiveEntry entry = new ZipArchiveEntry(infile.getName());
entry.setSize(infile.jsFunct... | 1 |
[CLS] public static void convertEncoding(File infile, File outfile, String from, String to) throws IOException, UnsupportedEncodingException {
InputStream in;
if (infile != null) in = new FileInputStream(infile); else in = System.in;
OutputStream out;
outfile.createNewFile();
if ... | 1 |
[CLS] private void saveFile(Folder folder, Object key, InputStream stream) throws FileManagerException {
File file = new File(folder, key.toString());
LOGGER.debug("Writing file: " + file.getAbsolutePath());
Writer writer = null;
Writer encodedWriter = null;
try {
enc... | 0 |
[CLS] public static void uncompress(File srcFile, File destFile) throws IOException {
InputStream input = null;
OutputStream output = null;
try {
input = new GZIPInputStream(new FileInputStream(srcFile));
output = new BufferedOutputStream(new FileOutputStream(destFile));
... | 1 |
[CLS] public static Properties addAttributes(Node node, String[] names, Properties props, LogEvent evt) throws ConfigurationException {
if (props == null) props = new Properties();
try {
MessageDigest md = MessageDigest.getInstance("MD5");
for (int i = 0; i < names.length; i++) {... | 1 |
[CLS] private final boolean copy_to_file_nio(File src, File dst) throws IOException {
FileChannel srcChannel = null, dstChannel = null;
try {
srcChannel = new FileInputStream(src).getChannel();
dstChannel = new FileOutputStream(dst).getChannel();
{
int... | 1 |
[CLS] public static boolean writeFileByBinary(InputStream pIs, File pFile, boolean pAppend) {
boolean flag = false;
try {
FileOutputStream fos = new FileOutputStream(pFile, pAppend);
IOUtils.copy(pIs, fos);
fos.flush();
fos.close();
pIs.close()... | 1 |
[CLS] public boolean ReadFile() {
boolean ret = false;
FilenameFilter FileFilter = null;
File dir = new File(fDir);
String[] FeeFiles;
int Lines = 0;
BufferedReader FeeFile = null;
PreparedStatement DelSt = null, InsSt = null;
String Line = null, Term = nu... | 0 |
[CLS] public void init(File file) {
InputStream is = null;
ByteArrayOutputStream os = null;
try {
is = new FileInputStream(file);
os = new ByteArrayOutputStream();
IOUtils.copy(is, os);
} catch (Throwable e) {
throw new VisualizerEngineExce... | 1 |
[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] public static synchronized BaseFont getL2BaseFont() {
if (l2baseFont == null) {
final ConfigProvider conf = ConfigProvider.getInstance();
try {
final ByteArrayOutputStream tmpBaos = new ByteArrayOutputStream();
String fontPath = conf.getNotEmptyPrope... | 0 |
[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] public static String getHash(String input) {
MessageDigest m;
try {
m = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
m.update(input.getBytes(), 0, input.length());
re... | 0 |
[CLS] private String protectMarkup(String content, String markupRegex, String replaceSource, String replaceTarget) {
Matcher matcher = Pattern.compile(markupRegex, Pattern.MULTILINE | Pattern.DOTALL).matcher(content);
StringBuffer result = new StringBuffer();
while (matcher.find()) {
... | 1 |
[CLS] public LinkedList<NameValuePair> getScoreboard() {
InputStream is = null;
String result = "";
LinkedList<NameValuePair> scores = new LinkedList<NameValuePair>();
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(domain);... | 1 |
[CLS] private String hashString(String key) {
MessageDigest digest;
try {
digest = java.security.MessageDigest.getInstance("MD5");
digest.update(key.getBytes());
byte[] hash = digest.digest();
BigInteger bi = new BigInteger(1, hash);
return Str... | 0 |
[CLS] public static String SHA(String s) {
try {
MessageDigest md = MessageDigest.getInstance("SHA");
md.update(s.getBytes(), 0, s.getBytes().length);
byte[] hash = md.digest();
StringBuilder sb = new StringBuilder();
int msb;
int lsb = 0;
... | 1 |
[CLS] public void insertStringInFile(String file, String textToInsert, long fromByte, long toByte) throws Exception {
String tmpFile = file + ".tmp";
BufferedInputStream in = null;
BufferedOutputStream out = null;
long byteCount = 0;
try {
in = new BufferedInputStream... | 0 |
[CLS] public static final void sequence(int[] list, int above) {
int temp, max, min;
boolean tag = true;
for (int i = list.length - 1; i >= 0; i--) {
for (int j = 0; j < i; j++) {
if (above < 0) {
if (list[j] < list[j + 1]) {
... | 0 |
[CLS] public void doInsertImage() {
logger.debug(">>> Inserting image...");
logger.debug(" fullFileName : #0", uploadedFileName);
String fileName = uploadedFileName.substring(uploadedFileName.lastIndexOf(File.separator) + 1);
logger.debug(" fileName : #0", fileName);
String newFi... | 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... | 0 |
[CLS] public JavaCodeAnalyzer(String filenameIn, String filenameOut, String lineLength) {
try {
File tmp = File.createTempFile("JavaCodeAnalyzer", "tmp");
BufferedReader br = new BufferedReader(new FileReader(filenameIn));
BufferedWriter out = new BufferedWriter(new FileWrite... | 1 |
[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... | 0 |
[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... | 1 |
[CLS] public boolean restore() {
try {
File sd = Environment.getExternalStorageDirectory();
File data = Environment.getDataDirectory();
if (sd.canWrite()) {
String currentDBPath = "/Android/bluebox.bak";
String backupDBPath = "/data/android.blu... | 0 |
[CLS] public String obfuscateString(String string) {
String obfuscatedString = null;
try {
MessageDigest md = MessageDigest.getInstance(ENCRYPTION_ALGORITHM);
md.update(string.getBytes());
byte[] digest = md.digest();
obfuscatedString = new String(Base64.e... | 1 |
[CLS] public static void main(String[] args) {
String host;
int port;
char[] passphrase;
System.out.println("InstallCert - Install CA certificate to Java Keystore");
System.out.println("=====================================================");
final BufferedReader reader =... | 1 |
[CLS] public static File copy(String inFileName, String outFileName) throws IOException {
File inputFile = new File(inFileName);
File outputFile = new File(outFileName);
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while (... | 1 |
[CLS] public static void copy(Object arg1, Object arg2) {
Writer writer = null;
Reader reader = null;
InputStream inStream = null;
OutputStream outStream = null;
try {
if (arg2 instanceof Writer) {
writer = (Writer) arg2;
if (arg1 insta... | 0 |
[CLS] public void writeValue(Value v) throws IOException, SQLException {
int type = v.getType();
writeInt(type);
switch(type) {
case Value.NULL:
break;
case Value.BYTES:
case Value.JAVA_OBJECT:
writeBytes(v.getBytesNoCopy());
... | 1 |
[CLS] public static String getMD5(final String data) {
try {
MessageDigest m = MessageDigest.getInstance("MD5");
m.reset();
m.update(data.getBytes());
BigInteger bigInt = new BigInteger(1, m.digest());
String hashtext = bigInt.toString(16);
... | 1 |
[CLS] public void readMESHDescriptorFileIntoFiles(String outfiledir) {
String inputLine, ins;
String filename = getMESHdescriptorfilename();
String uid = "";
String name = "";
String description = "";
String element_of = "";
Vector treenr = new Vector();
V... | 0 |
[CLS] public static void copyFile5(File srcFile, File destFile) throws IOException {
InputStream in = new FileInputStream(srcFile);
OutputStream out = new FileOutputStream(destFile);
IOUtils.copyLarge(in, out);
in.close();
out.close();
} [SEP] public void convert(File src, File dest) throws IOException {
... | 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] private boolean copy(File in, File out) {
try {
FileInputStream fis = new FileInputStream(in);
FileOutputStream fos = new FileOutputStream(out);
FileChannel readableChannel = fis.getChannel();
FileChannel writableChannel = fos.getChannel();
writa... | 1 |
[CLS] private String createCSVFile(String fileName) throws FileNotFoundException, IOException {
String csvFile = fileName + ".csv";
BufferedReader buf = new BufferedReader(new FileReader(fileName));
BufferedWriter out = new BufferedWriter(new FileWriter(csvFile));
String line;
wh... | 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] protected void setupService(MessageContext msgContext) throws Exception {
String realpath = msgContext.getStrProp(Constants.MC_REALPATH);
String extension = (String) getOption(OPTION_JWS_FILE_EXTENSION);
if (extension == null) extension = DEFAULT_JWS_FILE_EXTENSION;
if ((realpath !... | 1 |
[CLS] public boolean backupFile(File oldFile, File newFile) {
boolean isBkupFileOK = false;
FileChannel sourceChannel = null;
FileChannel targetChannel = null;
try {
sourceChannel = new FileInputStream(oldFile).getChannel();
targetChannel = new FileOutputStream(ne... | 1 |
[CLS] public static void zipMapBos(DitaBoundedObjectSet mapBos, File outputZipFile, MapBosProcessorOptions options) throws Exception {
log.debug("Determining zip file organization...");
BosVisitor visitor = new DxpFileOrganizingBosVisitor();
visitor.visit(mapBos);
if (!options.isQuiet())... | 1 |
[CLS] private void copyPhoto(final IPhoto photo, final Map.Entry<String, Integer> size) {
final File fileIn = new File(storageService.getPhotoPath(photo, storageService.getOriginalDir()));
final File fileOut = new File(storageService.getPhotoPath(photo, size.getKey()));
InputStream fileInputStre... | 1 |
[CLS] public SpreadSheetFrame(FileManager owner, File file, Delimiter delim) {
super(owner, file.getPath());
JPanel pane = new JPanel(new BorderLayout());
super.contentPane.add(pane);
this.tableModel = new BigTableModel(file, delim);
this.table = new JTable(tableModel);
t... | 1 |
[CLS] private void retrieveClasses(URL url, Map<String, T> cmds) {
try {
String resource = URLDecoder.decode(url.getPath(), "UTF-8");
File directory = new File(resource);
if (directory.exists()) {
String[] files = directory.list();
for (String ... | 0 |
[CLS] public static String crypt(String password, String salt) throws java.security.NoSuchAlgorithmException {
int saltEnd;
int len;
int value;
int i;
MessageDigest hash1;
MessageDigest hash2;
byte[] digest;
byte[] passwordBytes;
byte[] saltBytes;
... | 1 |
[CLS] public static String hash(String password) {
try {
MessageDigest digest = MessageDigest.getInstance(digestAlgorithm);
digest.update(password.getBytes(charset));
byte[] rawHash = digest.digest();
return new String(Hex.encodeHex(rawHash));
} catch (Exc... | 1 |
[CLS] @Override
protected String doInBackground(String... params) {
HttpURLConnection conn = null;
String localFilePath = params[0];
if (localFilePath == null) {
return null;
}
try {
URL url = new URL(ConnectionHandler.getServerURL() + ":" + Connection... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.