text string | label int64 |
|---|---|
[CLS] public static void copyURLToFile(URL source, File destination) throws IOException {
InputStream input = source.openStream();
try {
FileOutputStream output = openOutputStream(destination);
try {
IOUtils.copy(input, output);
} finally {
... | 1 |
[CLS] public static String encryptPassword(String password) {
try {
MessageDigest digest = java.security.MessageDigest.getInstance("SHA1");
digest.update(password.getBytes("UTF-8"));
byte[] hash = digest.digest();
StringBuffer buf = new StringBuffer();
... | 1 |
[CLS] private Image retrievePdsImage(double lat, double lon) {
imageDone = false;
try {
StringBuffer urlBuff = new StringBuffer(psdUrl + psdCgi + "?");
urlBuff.append("DATA_SET_NAME=" + dataSet);
urlBuff.append("&VERSION=" + version);
urlBuff.append("&PIXE... | 1 |
[CLS] public static String generateDigest(String message, String DigestAlgorithm) {
try {
MessageDigest md = MessageDigest.getInstance(DigestAlgorithm);
md.update(message.getBytes(), 0, message.length());
return new BigInteger(1, md.digest()).toString(16);
} catch (No... | 1 |
[CLS] public static int my_rename(String source, String dest) {
logger.debug("RENAME " + source + " to " + dest);
if (source == null || dest == null) return -1;
{
logger.debug("\tMoving file across file systems.");
FileChannel srcChannel = null;
... | 1 |
[CLS] public static String getTextFromUrl(final String url) {
InputStreamReader inputStreamReader = null;
BufferedReader bufferedReader = null;
try {
final StringBuilder result = new StringBuilder();
inputStreamReader = new InputStreamReader(new URL(url).openStream());
... | 0 |
[CLS] public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 1 |
[CLS] private void setManagedContent(Entry entry, Datastream vds) throws StreamIOException {
if (m_transContext == DOTranslationUtility.SERIALIZE_EXPORT_ARCHIVE && !m_format.equals(ATOM_ZIP1_1)) {
String mimeType = vds.DSMIME;
if (MimeTypeHelper.isText(mimeType) || MimeTypeHelper.isXml(m... | 1 |
[CLS] public void delUser(User user) throws SQLException, IOException, ClassNotFoundException {
String dbUserID;
String stockSymbol;
Statement stmt = con.createStatement();
try {
con.setAutoCommit(false);
dbUserID = user.getUserID();
if (getUser(dbUser... | 1 |
[CLS] public static boolean matchPassword(String prevPassStr, String newPassword) throws NoSuchAlgorithmException, java.io.IOException, java.io.UnsupportedEncodingException {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] seed = new byte[12];
byte[] prevPass = new sun.misc.BASE64Dec... | 1 |
[CLS] private boolean passwordMatches(String user, String plainPassword, String scrambledPassword) {
MessageDigest md;
byte[] temp_digest, pass_digest;
byte[] hex_digest = new byte[35];
byte[] scrambled = scrambledPassword.getBytes();
try {
md = MessageDigest.getInsta... | 1 |
[CLS] public static void writeToFile(final File file, final InputStream in) throws IOException {
IOUtils.createFile(file);
FileOutputStream fos = null;
try {
fos = new FileOutputStream(file);
IOUtils.copyStream(in, fos);
} finally {
IOUtils.closeIO(fos... | 1 |
[CLS] public static void copyFiles(String strPath, String dstPath) throws IOException {
File src = new File(strPath);
File dest = new File(dstPath);
if (src.isDirectory()) {
dest.mkdirs();
String list[] = src.list();
for (int i = 0; i < list.length; i++) {
... | 0 |
[CLS] public void load(String fileName) {
BufferedReader bufReader;
loaded = false;
vector.removeAllElements();
try {
if (fileName.startsWith("http:")) {
URL url = new URL(fileName);
bufReader = new BufferedReader(new InputStreamReader(url.open... | 1 |
[CLS] void IconmenuItem6_actionPerformed(ActionEvent e) {
JFileChooser jFileChooser1 = new JFileChooser();
String separator = "";
if (JFileChooser.APPROVE_OPTION == jFileChooser1.showOpenDialog(this.getFatherFrame())) {
setDefaultPath(jFileChooser1.getSelectedFile().getPath());
... | 0 |
[CLS] public static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOExc... | 1 |
[CLS] public void putFile(CompoundName file, FileInputStream fileInput) throws IOException {
File fullDir = new File(REMOTE_BASE_DIR.getCanonicalPath());
for (int i = 0; i < file.size() - 1; i++) fullDir = new File(fullDir, file.get(i));
fullDir.mkdirs();
File outputFile = new File(fullD... | 0 |
[CLS] public void fileCopy2(File inFile, File outFile) throws Exception {
try {
FileChannel srcChannel = new FileInputStream(inFile).getChannel();
FileChannel dstChannel = new FileOutputStream(outFile).getChannel();
dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
... | 1 |
[CLS] @Before
public void setUp() throws IOException {
testSbk = File.createTempFile("songbook", "sbk");
IOUtils.copy(Thread.currentThread().getContextClassLoader().getResourceAsStream("test.sbk"), new FileOutputStream(testSbk));
test1Sbk = File.createTempFile("songbook", "sbk");
IOU... | 1 |
[CLS] public static void downloadJars(IProject project, String repositoryUrl, String jarDirectory, String[] jars) {
try {
File tmpFile = null;
for (String jar : jars) {
try {
tmpFile = File.createTempFile("tmpPlugin_", ".zip");
URL ... | 1 |
[CLS] private static void writeOneAttachment(Context context, Writer writer, OutputStream out, Attachment attachment) throws IOException, MessagingException {
writeHeader(writer, "Content-Type", attachment.mMimeType + ";\n name=\"" + attachment.mFileName + "\"");
writeHeader(writer, "Content-Transfer-En... | 1 |
[CLS] private void fetchTree() throws IOException {
String urlString = BASE_URL + TREE_URL + DATASET_URL + "&family=" + mFamily;
URL url = new URL(urlString);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String toParse = in.readLine();
while (i... | 0 |
[CLS] public void test_UseCache_HttpURLConnection_NoCached_GetOutputStream() throws Exception {
ResponseCache.setDefault(new MockNonCachedResponseCache());
uc = (HttpURLConnection) url.openConnection();
uc.setChunkedStreamingMode(10);
uc.setDoOutput(true);
uc.getOutputStream();
... | 0 |
[CLS] public static void copyURLToFile(URL source, File destination) throws IOException {
if (destination.getParentFile() != null && !destination.getParentFile().exists()) {
destination.getParentFile().mkdirs();
}
if (destination.exists() && !destination.canWrite()) {
Str... | 0 |
[CLS] public static final String md5(final String s) {
try {
MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
digest.update(s.getBytes());
byte messageDigest[] = digest.digest();
StringBuffer hexString = new StringBuffer();
for (i... | 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] public boolean consolidateCrossrefGet(BiblioItem bib, ArrayList<BiblioItem> bib2) throws Exception {
boolean result = false;
String doi = bib.getDOI();
String aut = bib.getFirstAuthorSurname();
String title = bib.getTitle();
String firstPage = null;
String pageRange... | 0 |
[CLS] private static String getRegistrationClasses() {
CentralRegistrationClass c = new CentralRegistrationClass();
String name = c.getClass().getCanonicalName().replace('.', '/').concat(".class");
try {
Enumeration<URL> urlEnum = c.getClass().getClassLoader().getResources("META-INF/... | 0 |
[CLS] private void copy(File from, File to) throws IOException {
InputStream in = new FileInputStream(from);
OutputStream out = new FileOutputStream(to);
byte[] line = new byte[16384];
int bytes = -1;
while ((bytes = in.read(line)) != -1) out.write(line, 0, bytes);
in.clo... | 1 |
[CLS] public void copyServer(int id) throws Exception {
File in = new File("servers" + File.separatorChar + "server_" + id);
File serversDir = new File("servers" + File.separatorChar);
int newNumber = serversDir.listFiles().length + 1;
System.out.println("New File Number: " + newNumber);... | 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 void putMedia(Media m) {
if (m == null) {
return;
}
if (_conn == null) {
log.error("DatabaseDatastore not connected!");
return;
}
if (log.isTraceEnabled()) {
log.trace("Writing Media " + m.toString() + " to database");
... | 0 |
[CLS] public static final int executeSql(final Connection conn, final String sql, final boolean rollback) throws SQLException {
if (null == sql) return 0;
Statement stmt = null;
try {
stmt = conn.createStatement();
final int updated = stmt.executeUpdate(sql);
... | 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] @Override
protected void loadInternals(final File internDir, final ExecutionMonitor exec) throws IOException, CanceledExecutionException {
List<String> taxa = new Vector<String>();
String domain = m_domain.getStringValue();
String id = "";
if (domain.equalsIgnoreCase("Eukaryota... | 1 |
[CLS] public static void exportGestureSet(List<GestureSet> sets, File file) {
try {
FileOutputStream outputStream = new FileOutputStream(file);
IOUtils.copy(exportGestureSetsAsStream(sets), outputStream);
outputStream.close();
} catch (FileNotFoundException e) {
... | 1 |
[CLS] public static void main(String[] args) {
String str = "vbnjm7pexhlmof3kapi_key76bbc056cf516a844af25a763b2b8426auth_tokenff8080812374bd3f0123b60363a5230acomment_text你frob118edb4cb78b439207c2329b76395f9fmethodyupoo.photos.comments.addphoto_idff80808123922c950123b6066c946a3f";
MessageDigest md = null... | 0 |
[CLS] public InlineImageChunk(URL url) {
super();
this.url = url;
try {
URLConnection urlConn = url.openConnection();
urlConn.setReadTimeout(15000);
ImageInputStream iis = ImageIO.createImageInputStream(urlConn.getInputStream());
Iterator<ImageRead... | 0 |
[CLS] private void simulate() throws Exception {
BufferedWriter out = null;
out = new BufferedWriter(new FileWriter(outFile));
out.write("#Thread\tReputation\tAction\n");
out.flush();
System.out.println("Simulate...");
File file = new File(trsDemoSimulationfile);
... | 1 |
[CLS] private static InputStream connect(String url) throws IOException {
int status = 0;
String currentlyActiveServer = getCurrentlyActiveServer();
try {
long begin = System.currentTimeMillis();
HttpURLConnection httpConnection = (HttpURLConnection) new URL(currentlyActi... | 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 convertToSha1(final 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());
sha1has... | 0 |
[CLS] public static String digestString(String data) {
String result = null;
if (data != null) {
try {
MessageDigest _md = MessageDigest.getInstance("MD5");
_md.update(data.getBytes());
byte[] _digest = _md.digest();
String _ds ... | 0 |
[CLS] public void removeExifTag(File jpegImageFile, File dst) throws IOException, ImageReadException, ImageWriteException {
OutputStream os = null;
try {
TiffOutputSet outputSet = null;
IImageMetadata metadata = Sanselan.getMetadata(jpegImageFile);
JpegImageMetadata j... | 1 |
[CLS] public static void main(String[] args) throws Exception {
InputStream in = null;
try {
in = new URL(args[0]).openStream();
IOUtils.copyBytes(in, System.out, 4096, false);
} finally {
IOUtils.closeStream(in);
}
} [SEP] public static void copyF... | 1 |
[CLS] public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("LOAD")) {
JFileChooser chooser = new JFileChooser();
chooser.setFileFilter(new JPEGFilter());
chooser.setMultiSelectionEnabled(false);
if (chooser.showOpenDialog(getTopLevelAncesto... | 1 |
[CLS] public static void copyFile(File src, File dest, boolean force) throws IOException {
if (dest.exists()) {
if (force) {
dest.delete();
} else {
throw new IOException("Cannot overwrite existing file: " + dest);
}
}
byte[] bu... | 1 |
[CLS] private static String hashWithDigest(String in, String digest) {
try {
MessageDigest Digester = MessageDigest.getInstance(digest);
Digester.update(in.getBytes("UTF-8"), 0, in.length());
byte[] sha1Hash = Digester.digest();
return toSimpleHexString(sha1Hash);... | 1 |
[CLS] public boolean import_status(String filename) {
int pieceId;
int i, j, col, row;
int rotation;
int number;
boolean byurl = false;
e2piece temppiece;
String lineread;
StringTokenizer tok;
BufferedReader entree;
try {
if (by... | 0 |
[CLS] public void execute(HttpResponse response) throws HttpException, IOException {
StringBuffer content = new StringBuffer();
NodeSet allNodes = membershipRegistry.listAllMembers();
for (Node node : allNodes) {
content.append(node.getId().toString());
content.append(Sys... | 0 |
[CLS] public void test() throws Exception {
StorageString s = new StorageString("UTF-8");
s.addText("Test");
try {
s.getOutputStream();
fail("Should throw IOException as method not supported.");
} catch (IOException e) {
}
try {
s.getWr... | 1 |
[CLS] protected void createValueListAnnotation(IProgressMonitor monitor, IPackageFragment pack, Map model) throws CoreException {
IProject pj = pack.getJavaProject().getProject();
QualifiedName qn = new QualifiedName(JstActivator.PLUGIN_ID, JstActivator.PACKAGE_INFO_LOCATION);
String location = ... | 0 |
[CLS] public static int zipFile(File file_input, File dir_output) {
File zip_output = new File(dir_output, file_input.getName() + ".zip");
ZipOutputStream zip_out_stream;
try {
FileOutputStream out = new FileOutputStream(zip_output);
zip_out_stream = new ZipOutputStream(n... | 1 |
[CLS] protected static boolean isLatestVersion(double myVersion, String referenceAddress) {
Scanner scanner = null;
try {
URL url = new URL(referenceAddress);
InputStream iS = url.openStream();
scanner = new Scanner(iS);
String firstLine = scanner.nextLine... | 0 |
[CLS] public void elimina(Cliente cli) throws errorSQL, errorConexionBD {
System.out.println("GestorCliente.elimina()");
int id = cli.getId();
String sql;
Statement stmt = null;
try {
gd.begin();
sql = "DELETE FROM cliente WHERE cod_cliente =" + id;
... | 1 |
[CLS] public ResourceMigratorBuilder createResourceMigratorBuilder(NotificationReporter reporter) {
return new ResourceMigratorBuilder() {
public ResourceMigrator getCompletedResourceMigrator() {
return new ResourceMigrator() {
public void migrat... | 1 |
[CLS] public static byte[] 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()... | 1 |
[CLS] public static boolean encodeFileToFile(String infile, String outfile) {
boolean success = false;
java.io.InputStream in = null;
java.io.OutputStream out = null;
try {
in = new Base64.InputStream(new java.io.BufferedInputStream(new java.io.FileInputStream(infile)), Base6... | 1 |
[CLS] public boolean isServerAlive(String pStrURL) {
boolean isAlive;
long t1 = System.currentTimeMillis();
try {
URL url = new URL(pStrURL);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
while (... | 0 |
[CLS] public static String md5(String input) {
byte[] temp;
try {
MessageDigest messageDigest;
messageDigest = MessageDigest.getInstance("MD5");
messageDigest.update(input.getBytes());
temp = messageDigest.digest();
} catch (Exception e) {
... | 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 handleInterfaceUp(long eventID, long nodeID, String ipAddr, String eventTime) {
Category log = ThreadCategory.getInstance(OutageWriter.class);
if (eventID == -1 || nodeID == -1 || ipAddr == null) {
log.warn(EventConstants.INTERFACE_UP_EVENT_UEI + " ignored - info incomplet... | 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] public static void copyFile(File srcFile, File desFile) throws IOException {
AssertUtility.notNull(srcFile);
AssertUtility.notNull(desFile);
FileInputStream fis = new FileInputStream(srcFile);
FileOutputStream fos = new FileOutputStream(desFile);
try {
FileChann... | 1 |
[CLS] public static void copyFile(String source, String destination, TimeSlotTracker timeSlotTracker) {
LOG.info("copying [" + source + "] to [" + destination + "]");
BufferedInputStream sourceStream = null;
BufferedOutputStream destStream = null;
try {
File destinationFile =... | 0 |
[CLS] public static String getStringFromInputStream(InputStream in) throws Exception {
CachedOutputStream bos = new CachedOutputStream();
IOUtils.copy(in, bos);
in.close();
bos.close();
return bos.getOut().toString();
} [SEP] public static boolean encodeFileToFile(String infi... | 1 |
[CLS] private void writeMessage(ChannelBuffer buffer, File dst) throws IOException {
ChannelBufferInputStream is = new ChannelBufferInputStream(buffer);
OutputStream os = null;
try {
os = new FileOutputStream(dst);
IOUtils.copyLarge(is, os);
} finally {
... | 1 |
[CLS] @Transient
private String md5sum(String text) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.reset();
md.update(text.getBytes());
byte messageDigest[] = md.digest();
return bufferToHex(messageDigest, 0, messageDigest.length);... | 0 |
[CLS] public static void copier(final File pFichierSource, final File pFichierDest) {
FileChannel vIn = null;
FileChannel vOut = null;
try {
vIn = new FileInputStream(pFichierSource).getChannel();
vOut = new FileOutputStream(pFichierDest).getChannel();
vIn.tra... | 1 |
[CLS] public static void loginSkyDrive() throws Exception {
System.out.println("login ");
u = new URL(loginurl);
uc = (HttpURLConnection) u.openConnection();
uc.setRequestProperty("Cookie", msprcookie + ";" + mspokcookie);
uc.setDoOutput(true);
uc.setRequestMethod("POST")... | 0 |
[CLS] public synchronized String encrypt(String p_plainText) throws ServiceUnavailableException {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
throw new ServiceUnavailableException(e.getMessage());
}
... | 0 |
[CLS] protected String getRequestContent(String urlText) throws Exception {
URL url = new URL(urlText);
HttpURLConnection urlcon = (HttpURLConnection) url.openConnection();
String line = null;
try {
urlcon.setUseCaches(false);
urlcon.connect();
Buffere... | 0 |
[CLS] public static String getWhatsNew(String ver) {
URL url = null;
try {
url = new URL("http://googlemeupdate.bravehost.com/History.htm");
} catch (MalformedURLException ex) {
ex.printStackTrace();
}
InputStream html = null;
try {
htm... | 0 |
[CLS] public String kodetu(String testusoila) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA");
md.update(testusoila.getBytes("UTF-8"));
} catch (NoSuchAlgorithmException e) {
new MezuLeiho("Ez da zifraketa algoritmoa aurkitu", "Ados", "Z... | 0 |
[CLS] public static byte[] expandPasswordToKeySSHCom(String password, int keyLen) {
try {
if (password == null) {
password = "";
}
MessageDigest md5 = MessageDigest.getInstance("MD5");
int digLen = md5.getDigestLength();
byte[] buf = ne... | 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] protected synchronized Class findClass(String className) {
LOG.info("FIND class:" + className);
String urlName = className.replace('.', '/');
byte buf[];
Class currentClass;
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
int i = clas... | 0 |
[CLS] public static void loadMessages(String filename, Map<String, String> map) throws FileNotFoundException, IOException {
String line;
URL url = CurrentLocale.class.getResource("MessagesBundle_" + filename + ".properties");
InputStreamReader isr = new InputStreamReader(url.openStream());
... | 0 |
[CLS] public void createResource(String resourceUri, boolean publish, User user) throws IOException {
PermissionAPI perAPI = APILocator.getPermissionAPI();
Logger.debug(this.getClass(), "createResource");
resourceUri = stripMapping(resourceUri);
String hostName = getHostname(resourceUri)... | 0 |
[CLS] protected static void copyDeleting(File source, File dest) throws ErrorCodeException {
byte[] buf = new byte[8 * 1024];
FileInputStream in = null;
try {
in = new FileInputStream(source);
try {
FileOutputStream out = new FileOutputStream(dest);
... | 1 |
[CLS] public static void copiaAnexos(String from, String to, AnexoTO[] anexoTO) {
FileChannel in = null, out = null;
for (int i = 0; i < anexoTO.length; i++) {
try {
in = new FileInputStream(new File((uploadDiretorio.concat(from)).concat(File.separator + anexoTO[i].getNome())... | 1 |
[CLS] public static void compress(File srcFile, File destFile) throws IOException {
InputStream input = null;
OutputStream output = null;
try {
input = new BufferedInputStream(new FileInputStream(srcFile));
output = new GZIPOutputStream(new FileOutputStream(destFile));
... | 0 |
[CLS] public static String md5Encode16(String s) {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(s.getBytes("utf-8"));
byte b[] = md.digest();
int i;
StringBuilder buf = new StringBuilder("");
for (int offset = 0; off... | 0 |
[CLS] public TapdocContextImpl(Registry registry, FileObject javaDom, List<String> javadocLinks, List<String> libraryLocations, FileObject outputDirectory, List<String> tapdocLinks, DocumentGenerator documentGenerator) {
this.registry = registry;
this.documentGenerator = documentGenerator;
try {... | 0 |
[CLS] private long generateNativeInstallExe(File nativeInstallFile, String instTemplate, File instClassFile) throws IOException {
InputStream reader = getClass().getResourceAsStream("/" + instTemplate);
ByteArrayOutputStream content = new ByteArrayOutputStream();
String installClassVarStr = "000... | 1 |
[CLS] public static void copyFile(File in, File out) throws IOException {
FileChannel inChannel = new FileInputStream(in).getChannel();
FileChannel outChannel = new FileOutputStream(out).getChannel();
try {
inChannel.transferTo(0, inChannel.size(), outChannel);
} catch (IOExc... | 1 |
[CLS] public void run() {
try {
URL url = new URL("http://pokedev.org/time.php");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
StringTokenizer s = new StringTokenizer(in.readLine());
m_day = Integer.parseInt(s.nextToken());
... | 0 |
[CLS] private File getTestFile() {
final URL url = TestCrueLOG.class.getResource(FICHIER_TEST_XML);
final File ctfaFile = new File(createTempDir(), "resultat.rtfa.xml");
try {
CtuluLibFile.copyStream(url.openStream(), new FileOutputStream(ctfaFile), true, true);
} catch (Exce... | 0 |
[CLS] public boolean backupLastAuditSchema(File lastAuditSchema) {
boolean isBkupFileOK = false;
String writeTimestamp = DateFormatUtils.format(new java.util.Date(), configFile.getTimestampPattern());
File target = new File(configFile.getAuditSchemaFileDir() + File.separator + configFile.getAudi... | 1 |
[CLS] public static int numberofLines(JApplet ja, String filename) {
int count = 0;
URL url = null;
String FileToRead;
FileToRead = "data/" + filename + ".csv";
try {
url = new URL(ja.getCodeBase(), FileToRead);
} catch (MalformedURLException e) {
... | 0 |
[CLS] private boolean getCached(Get g) throws IOException {
boolean ret = false;
File f = getCachedFile(g);
if (f.exists()) {
InputStream is = null;
OutputStream os = null;
try {
is = new FileInputStream(f);
os = new FileOutputS... | 1 |
[CLS] public void updatePortletName(PortletName portletNameBean) {
DatabaseAdapter dbDyn = null;
PreparedStatement ps = null;
try {
dbDyn = DatabaseAdapter.getInstance();
String sql = "update WM_PORTAL_PORTLET_NAME " + "set TYPE=? " + "where ID_SITE_CTX_TYPE=?";
... | 0 |
[CLS] public static long copyFile(File source, File target) throws IOException {
FileInputStream fileInputStream = null;
FileOutputStream fileOutputStream = null;
try {
fileInputStream = new FileInputStream(source);
fileOutputStream = new FileOutputStream(target);
... | 1 |
[CLS] public void shouldAllowClosingInputStreamTwice() throws IOException {
OutputStream outputStream = fileSystem.createOutputStream(_("hello"), OutputMode.OVERWRITE);
outputStream.write(new byte[] { 1, 2, 3 });
outputStream.close();
InputStream inputStream = fileSystem.createInputStrea... | 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 static String SHA1(String password) throws BusinessException {
try {
MessageDigest digest = MessageDigest.getInstance("SHA-1");
digest.update(password.getBytes());
BigInteger hash = new BigInteger(1, digest.digest());
return hash.toString(16);
... | 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 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] public Configuration(URL url) {
InputStream in = null;
try {
load(in = url.openStream());
} catch (Exception e) {
throw new RuntimeException("Could not load configuration from " + url, e);
} finally {
if (in != null) {
try {
... | 0 |
[CLS] public static Document validateXml(File messageFile, URL inputUrl, String[] catalogs) throws IOException, ParserConfigurationException, Exception, SAXException, FileNotFoundException {
InputSource source = new InputSource(inputUrl.openStream());
Document logDoc = DomUtil.getNewDom();
XMLRe... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.