text string | label int64 |
|---|---|
[CLS] public void save(File f, AudioFileFormat.Type t) throws IOException {
if (t.getExtension().equals("raw")) {
IOUtils.copy(makeInputStream(), new FileOutputStream(f));
} else {
AudioSystem.write(makeStream(), t, f);
}
} [SEP] public Object mapRow(ResultSet rs, int... | 1 |
[CLS] public static void main(String[] argv) throws IOException {
int i;
for (i = 0; i < argv.length; i++) {
if (argv[i].charAt(0) != '-') break;
++i;
switch(argv[i - 1].charAt(1)) {
case 'b':
try {
flag_pred... | 0 |
[CLS] public static Class[] findSubClasses(Class baseClass) {
String packagePath = "/" + baseClass.getPackage().getName().replace('.', '/');
URL url = baseClass.getResource(packagePath);
if (url == null) {
return new Class[0];
}
List<Class> derivedClasses = new ArrayL... | 0 |
[CLS] public static String encode(String arg) {
if (arg == null) {
arg = "";
}
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
md5.update(arg.getBytes(JavaCenterHome.JCH_CHARSET));
} catch (Exception e) {
e.p... | 0 |
[CLS] public Item findById(String itemId) throws UnsupportedEncodingException, IOException {
String sessionId = (String) RuntimeAccess.getInstance().getSession().getAttribute("SESSION_ID");
DefaultHttpClient httpclient = new DefaultHttpClient();
FindItemByIdRequest request = new FindItemByIdRequ... | 0 |
[CLS] public static boolean urlStrIsDir(String urlStr) {
if (urlStr.endsWith("/")) return true;
int lastSlash = urlStr.lastIndexOf('/');
int lastPeriod = urlStr.lastIndexOf('.');
if (lastPeriod != -1 && (lastSlash == -1 || lastPeriod > lastSlash)) return false;
String urlStrWithS... | 0 |
[CLS] private String getLatestVersion(URL url) throws IOException {
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.connect();
BufferedReader br = new BufferedReader(new InputStreamReader(new BufferedInputStream(con.getInputStream())));
String lines = "";
St... | 0 |
[CLS] public void SendFile(File testfile) {
try {
SocketChannel sock = SocketChannel.open(new InetSocketAddress("127.0.0.1", 1234));
sock.configureBlocking(true);
while (!sock.finishConnect()) {
System.out.println("NOT connected!");
}
S... | 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... | 1 |
[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] public static File enregistrerFichier(String fileName, File file, String path, String fileMime) throws Exception {
if (file != null) {
try {
HttpServletRequest request = ServletActionContext.getRequest();
HttpSession session = request.getSession();
... | 1 |
[CLS] public static String contents(URL url) throws IOException {
InputStream is = url.openStream();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
while (true) {
int len = is.read(buf);
if (len < 0) {
break;... | 0 |
[CLS] public static byte[] clearPassToUserPassword(String clearpass, HashAlg alg, byte[] salt) {
if (alg == null) {
throw new IllegalArgumentException("Invalid hash argorithm.");
}
try {
MessageDigest digester = null;
StringBuilder resultInText = new StringBui... | 0 |
[CLS] private HashSet<String> href(String urlstr) throws IOException {
HashSet<String> hrefs = new HashSet<String>();
URL url = new URL(urlstr);
URLConnection con = url.openConnection();
con.setRequestProperty("Cookie", "_session_id=" + _session_id);
InputStreamReader r = new Inp... | 0 |
[CLS] public static byte[] expandPasswordToKey(String password, int keyLen, byte[] salt) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
int digLen = md5.getDigestLength();
byte[] mdBuf = new byte[digLen];
byte[] key = new byte[keyLen];
i... | 0 |
[CLS] public static void main(String[] args) throws Exception {
DES des = new DES();
StreamBlockReader reader = new StreamBlockReader(new FileInputStream("D:\\test1.txt"));
StreamBlockWriter writer = new StreamBlockWriter(new FileOutputStream("D:\\test2.txt"));
SingleKey key = new Single... | 1 |
[CLS] protected void givenGroupRepository(String repoId, String providerId, Repository... memberRepos) throws AuthenticationException, UnsupportedEncodingException, IOException, ClientProtocolException {
HttpResponse response = executeDeleteWithResponse(format("/repo_groups/%s", repoId));
consume(respon... | 0 |
[CLS] public MoteDeploymentConfiguration addMoteDeploymentConfiguration(int projectDepConfID, int moteID, int programID, int radioPowerLevel) throws AdaptationException {
MoteDeploymentConfiguration mdc = null;
Connection connection = null;
Statement statement = null;
ResultSet resultSet... | 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] private static String getHashString(String text, String algorithm) throws NoSuchAlgorithmException, UnsupportedEncodingException {
AssertUtility.notNull(text);
AssertUtility.notNullAndNotSpace(algorithm);
MessageDigest md;
md = MessageDigest.getInstance(algorithm);
md.updat... | 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... | 1 |
[CLS] @Override
public void copyFile2File(final File src, final File dest, final boolean force) throws C4JException {
if (dest.exists()) if (force && !dest.delete()) throw new C4JException(format("Copying ‘%s’ to ‘%s’ failed; cannot overwrite existing file.", src.getPath(), dest.getPath()));
FileCha... | 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 sendPostRequest() {
String data = "text=Eschirichia coli";
try {
URL url = new URL("http://taxonfinder.ubio.org/analyze?");
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputSt... | 1 |
[CLS] public static byte[] getHashedID(String ID) {
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
md5.reset();
md5.update(ID.getBytes());
byte[] digest = md5.digest();
byte[] bytes = new byte[WLDB_ID_SIZE];
for (int i = 0; i <... | 0 |
[CLS] public static String sha1(String clearText, String seed) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update((seed + clearText).getBytes());
return convertToHex(md.digest());
} catch (Exception e) {
throw new RuntimeException(e.g... | 1 |
[CLS] @Override
public void run() {
URL url = null;
FileOutputStream fos = null;
FTPClient ftp = null;
try {
url = new URL(super.getAddress());
String host = url.getHost();
String folder = StringUtils.substringBeforeLast(url.getPath(), "/");
... | 0 |
[CLS] public File copyFile(File f) throws IOException {
File t = createNewFile("fm", "cpy");
FileOutputStream fos = new FileOutputStream(t);
FileChannel foc = fos.getChannel();
FileInputStream fis = new FileInputStream(f);
FileChannel fic = fis.getChannel();
foc.transferF... | 1 |
[CLS] public void create(File target) {
if ("dir".equals(type)) {
File dir = new File(target, name);
dir.mkdirs();
for (Resource c : children) {
c.create(dir);
}
} else if ("package".equals(type)) {
String[] dirs = name.split("\... | 0 |
[CLS] public void test3() throws FileNotFoundException, IOException {
Decoder decoder1 = new MP3Decoder(new FileInputStream("/home/marc/tmp/test1.mp3"));
Decoder decoder2 = new OggDecoder(new FileInputStream("/home/marc/tmp/test1.ogg"));
FileOutputStream out = new FileOutputStream("/home/marc/tm... | 1 |
[CLS] public static void extract(final File destDir, final Collection<ZipEntryInfo> entryInfos) throws IOException {
if (destDir == null || CollectionUtils.isEmpty(entryInfos)) throw new IllegalArgumentException("One or parameter is null or empty!");
if (!destDir.exists()) destDir.mkdirs();
for ... | 1 |
[CLS] public static void main(String[] args) throws Throwable {
Options options = new Options();
options.addOption(new CommandLineOptionBuilder("cas", "cas file").isRequired(true).build());
options.addOption(new CommandLineOptionBuilder("o", "output directory").longName("outputDir").isRequired(t... | 1 |
[CLS] public void moveRuleUp(String language, String tag, int row) throws FidoDatabaseException {
try {
Connection conn = null;
Statement stmt = null;
try {
conn = fido.util.FidoDataSource.getConnection();
conn.setAutoCommit(false);
... | 0 |
[CLS] public static void main(String[] args) throws Exception {
String infile = "C:\\copy.sql";
String outfile = "C:\\copy.txt";
FileInputStream fin = new FileInputStream(infile);
FileOutputStream fout = new FileOutputStream(outfile);
FileChannel fcin = fin.getChannel();
... | 1 |
[CLS] public static void copy(FileInputStream source, FileOutputStream target) throws IOException {
FileChannel sourceChannel = source.getChannel();
FileChannel targetChannel = target.getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), targetChannel);
sourceChannel.close();
... | 1 |
[CLS] protected File compress(File orig, IWrapCompression wrapper) throws IOException {
File compressed = File.createTempFile("test.", ".gz");
FileOutputStream fos = new FileOutputStream(compressed);
OutputStream wos = wrapper.wrap(fos);
FileInputStream fis = new FileInputStream(orig);
... | 1 |
[CLS] public SearchHandler(String criteria, int langId) {
try {
URL url = new URL("http://eiffel.itba.edu.ar/hci/service/Catalog.groovy?method=GetProductListByName&criteria=" + criteria + "&language_id=" + langId);
URLConnection urlc = url.openConnection();
urlc.setDoOutput(f... | 0 |
[CLS] @Override
public void process(HttpServletRequest request, HttpServletResponse response) throws Exception {
String userAgentGroup = processUserAgent(request);
final LiwenxRequest lRequest = new LiwenxRequestImpl(request, response, messageSource, userAgentGroup);
Locator loc = router.rou... | 1 |
[CLS] public static final boolean compressToZip(final String sSource, final String sDest, final boolean bDeleteSourceOnSuccess) {
ZipOutputStream os = null;
InputStream is = null;
try {
os = new ZipOutputStream(new FileOutputStream(sDest));
is = new FileInputStream(sSourc... | 1 |
[CLS] private void copy(File sourceFile, File destinationFile) {
try {
FileChannel in = new FileInputStream(sourceFile).getChannel();
FileChannel out = new FileOutputStream(destinationFile).getChannel();
try {
in.transferTo(0, in.size(), out);
... | 1 |
[CLS] public final String latestVersion() {
String latestVersion = "";
try {
URL url = new URL(Constants.officialSite + ":80/LatestVersion");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String str;
while ((str = in.read... | 0 |
[CLS] @SuppressWarnings("unchecked")
private int syncCustomers() throws RemoteException, BasicException {
dlintegration.syncCustomersBefore();
ArrayList<String> notToSync = new ArrayList<String>();
int step = 0;
User[] remoteUsers;
int cpt = 0;
do {
remote... | 0 |
[CLS] public void copyFile(File sourceFile, String toDir, boolean create, boolean overwrite) throws FileNotFoundException, IOException {
FileInputStream source = null;
FileOutputStream destination = null;
byte[] buffer;
int bytes_read;
File toFile = new File(toDir);
if (c... | 1 |
[CLS] public void testCodingFromFileSmaller() throws Exception {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
WritableByteChannel channel = newChannel(baos);
HttpParams params = new BasicHttpParams();
SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 128, params... | 0 |
[CLS] public PollSetMessage(String username, String question, String title, String[] choices) {
this.username = username;
MessageDigest m = null;
try {
m = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException ex) {
ex.printStackTrace();
}
... | 1 |
[CLS] public static void copy(File source, File target) {
FileChannel in = null;
FileChannel out = null;
try {
in = new FileInputStream(source).getChannel();
out = new FileOutputStream(target).getChannel();
ByteBuffer buffer = ByteBuffer.allocateDirect(BUFFER)... | 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] private URLConnection openConnection(final URL url) throws IOException {
try {
return (URLConnection) AccessController.doPrivileged(new PrivilegedExceptionAction() {
public Object run() throws IOException {
return url.openConnection();
}
... | 0 |
[CLS] private static void copy(String from_name, String to_name) throws IOException {
File from_file = new File(from_name);
File to_file = new File(to_name);
if (!from_file.exists()) abort("�������� ���� �� ���������" + from_file);
if (!from_file.isFile()) abort("���������� ����������� �... | 1 |
[CLS] public static File jar(File in, String outArc, File tempDir, PatchConfigXML conf) {
FileOutputStream arcFile = null;
JarOutputStream jout = null;
DirectoryScanner ds = null;
ds = new DirectoryScanner();
ds.setCaseSensitive(true);
ds.setBasedir(in);
ds.scan()... | 0 |
[CLS] public static void copyFile(File src, File dest) throws IOException {
FileInputStream fis = new FileInputStream(src);
FileOutputStream fos = new FileOutputStream(dest);
FileChannel channelSrc = fis.getChannel();
FileChannel channelDest = fos.getChannel();
channelSrc.transfe... | 1 |
[CLS] public static void main(String[] args) throws Exception {
ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext("camel/exec-context.xml");
CamelContext context = appContext.getBean(CamelContext.class);
Exchange exchange = new DefaultExchange(context);
List<... | 1 |
[CLS] private void load() throws SQLException {
Connection conn = null;
Statement stmt = null;
try {
conn = FidoDataSource.getConnection();
conn.setAutoCommit(false);
stmt = conn.createStatement();
ClearData.clearTables(stmt);
stmt.exec... | 1 |
[CLS] public void process(String dir) {
String[] list = new File(dir).list();
if (list == null) return;
int n = list.length;
long[] bubblesort = new long[list.length + 1];
if (!statustext) {
IJ.log("Current Directory is: " + dir);
IJ.log(" ");
... | 0 |
[CLS] public String getScenarioData(String urlForSalesData) throws IOException, Exception {
InputStream inputStream = null;
BufferedReader bufferedReader = null;
DataInputStream input = null;
StringBuffer sBuf = new StringBuffer();
Proxy proxy;
if (httpWebProxyServer != n... | 0 |
[CLS] public he3Decode(String in_file) {
try {
File out = new File(in_file + extension);
File in = new File(in_file);
int file_size = (int) in.length();
FileInputStream in_stream = new FileInputStream(in_file);
out.createNewFile();
FileOutp... | 1 |
[CLS] public static synchronized String encrypt(String plaintext) throws NoSuchAlgorithmException, UnsupportedEncodingException {
MessageDigest md = null;
md = MessageDigest.getInstance("SHA");
md.update(plaintext.getBytes("UTF-8"));
byte raw[] = md.digest();
String hash = (new B... | 0 |
[CLS] public static String encrypt(String text) {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException ex) {
throw new WebDocRuntimeException(ex);
}
md.update(text.getBytes());
BigInteger hash = ne... | 1 |
[CLS] private static String getHash(char[] passwd, String algorithm) throws NoSuchAlgorithmException {
MessageDigest alg = MessageDigest.getInstance(algorithm);
alg.reset();
alg.update(new String(passwd).getBytes());
byte[] digest = alg.digest();
StringBuilder sb = new StringBuil... | 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... | 1 |
[CLS] public static boolean copyFile(File sourceFile, File destFile) {
FileChannel srcChannel = null;
FileChannel dstChannel = null;
try {
srcChannel = new FileInputStream(sourceFile).getChannel();
dstChannel = new FileOutputStream(destFile).getChannel();
long... | 1 |
[CLS] protected byte[] computeHash() {
try {
final MessageDigest inputHash = MessageDigest.getInstance("SHA");
inputHash.update(bufferFileData().getBytes());
return inputHash.digest();
} catch (final NoSuchAlgorithmException nsae) {
lastException = nsae;
... | 1 |
[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 TestReport runImpl() throws Exception {
DocumentFactory df = new SAXDocumentFactory(GenericDOMImplementation.getDOMImplementation(), parserClassName);
File f = (new File(testFileName));
URL url = f.toURL();
Document doc = df.createDocument(null, rootTag, url.toString(), url.... | 0 |
[CLS] private void zip(String object, TupleOutput output) {
byte array[] = object.getBytes();
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
GZIPOutputStream out = new GZIPOutputStream(baos);
ByteArrayInputStream in = new ByteArray... | 1 |
[CLS] protected byte[] readGZippedBytes(TupleInput in) {
final boolean is_compressed = in.readBoolean();
byte array[] = readBytes(in);
if (array == null) return null;
if (!is_compressed) {
return array;
}
try {
ByteArrayInputStream bais = new ByteA... | 0 |
[CLS] private String sendMessage(HttpURLConnection connection, String reqMessage) throws IOException, XMLStreamException {
if (msgLog.isTraceEnabled()) msgLog.trace("Outgoing SOAPMessage\n" + reqMessage);
BufferedOutputStream out = new BufferedOutputStream(connection.getOutputStream());
out.writ... | 1 |
[CLS] public static void copyFile(File fileIn, File fileOut) throws IOException {
FileChannel chIn = new FileInputStream(fileIn).getChannel();
FileChannel chOut = new FileOutputStream(fileOut).getChannel();
try {
chIn.transferTo(0, chIn.size(), chOut);
} catch (IOException e)... | 1 |
[CLS] public static void main(String[] args) throws IOException {
if (args.length == 0) {
System.out.println("Usage: \nGZIPcompress file\n" + "\tUses GZIP compression to compress " + "the file to test.gz");
System.exit(1);
}
BufferedReader in = new BufferedReader(new File... | 1 |
[CLS] public static URL getComponentXmlFileWith(String name) throws Exception {
List<URL> all = getComponentXmlFiles();
for (URL url : all) {
InputStream stream = null;
try {
stream = url.openStream();
Element root = XML.getRootElement(stream);
... | 0 |
[CLS] public void test() throws Exception {
File temp = File.createTempFile("test", ".test");
temp.deleteOnExit();
StorageFile s = new StorageFile(temp, "UTF-8");
s.addText("Test");
s.getOutputStream().write("ing is important".getBytes("UTF-8"));
s.getWriter().write(" but... | 0 |
[CLS] public static void writeToPetrify(TransitionSystem ts, Writer bw) throws IOException {
File temp = new File("_temp");
BufferedWriter tw = new BufferedWriter(new FileWriter(temp));
BufferedReader tr = new BufferedReader(new FileReader(temp));
HashSet<ModelGraphVertex> sources = new ... | 1 |
[CLS] public void constructAssociationView() {
String className;
String methodName;
String field;
boolean foundRead = false;
boolean foundWrite = false;
boolean classWritten = false;
try {
AssocView = new BufferedWriter(new FileWriter("InfoFiles/Associ... | 1 |
[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 void salva(UploadedFile imagem, Usuario usuario) {
File destino = new File(pastaImagens, usuario.getId() + ".imagem");
try {
IOUtils.copyLarge(imagem.getFile(), new FileOutputStream(destino));
} catch (IOException e) {
throw new RuntimeException("Erro ao copi... | 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());
... | 1 |
[CLS] public static void copy(String a, String b) throws IOException {
File inputFile = new File(a);
File outputFile = new File(b);
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read()) != -1) out.write(c);
... | 0 |
[CLS] public static String buildUserPassword(String password) {
String result = "";
MessageDigest md;
try {
md = MessageDigest.getInstance("MD5");
md.update(password.getBytes("UTF8"));
byte[] hash = md.digest();
for (int i = 0; i < hash.length; i++... | 1 |
[CLS] public static void fileCopy(String src, String dst) {
try {
FileInputStream fis = new FileInputStream(src);
FileOutputStream fos = new FileOutputStream(dst);
int read = -1;
byte[] buf = new byte[8192];
while ((read = fis.read(buf)) != -1) {
... | 1 |
[CLS] public static void copyFile(File source, File dest) throws Exception {
log.warn("File names are " + source.toString() + " and " + dest.toString());
if (!dest.getParentFile().exists()) dest.getParentFile().mkdir();
FileChannel sourceChannel = new FileInputStream(source).getChannel();
... | 0 |
[CLS] private String mkSid() {
String temp = toString();
MessageDigest messagedigest = null;
try {
messagedigest = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
messagediges... | 0 |
[CLS] public int create(BusinessObject o) throws DAOException {
int insert = 0;
int id = 0;
Account acc = (Account) o;
try {
PreparedStatement pst = connection.prepareStatement(XMLGetQuery.getQuery("INSERT_ACCOUNT"));
pst.setString(1, acc.getName());
p... | 1 |
[CLS] public static void copyFile(File source, File target) throws Exception {
if (source.isDirectory()) {
if (!target.isDirectory()) {
target.mkdirs();
}
String[] children = source.list();
for (int i = 0; i < children.length; i++) {
... | 1 |
[CLS] private boolean downloadBlacklist() {
boolean blacklist_updated = false;
try {
mLogger.debug("Attempting to download MT blacklist");
URL url = new URL(blacklistURL);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.... | 0 |
[CLS] private void saveAttachment(long messageId, Part attachment, boolean saveAsNew) throws IOException, MessagingException {
long attachmentId = -1;
Uri contentUri = null;
int size = -1;
File tempAttachmentFile = null;
if ((!saveAsNew) && (attachment instanc... | 1 |
[CLS] public DoSearch(String searchType, String searchString) {
String urlString = dms_url + "/servlet/com.ufnasoft.dms.server.ServerDoSearch";
String rvalue = "";
String filename = dms_home + FS + "temp" + FS + username + "search.xml";
try {
String urldata = urlString + "?us... | 1 |
[CLS] public static String get(String strUrl) {
if (NoMuleRuntime.DEBUG) System.out.println("GET : " + strUrl);
try {
URL url = new URL(strUrl);
URLConnection conn = url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream... | 0 |
[CLS] public String doAdd(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
if (logger.isDebugEnabled()) {
logger.debug("doAdd(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse) - start");
}
t_informa... | 1 |
[CLS] @Test
public void testCopyOverSize() throws IOException {
final InputStream in = new ByteArrayInputStream(TEST_DATA);
final ByteArrayOutputStream out = new ByteArrayOutputStream(TEST_DATA.length);
final int cpySize = ExtraIOUtils.copy(in, out, TEST_DATA.length + Long.SIZE);
ass... | 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;... | 1 |
[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 void createGraphicalViewer(Composite parent) {
viewer = new ScrollingGraphicalViewer();
viewer.createControl(parent);
viewer.getControl().setBackground(parent.getBackground());
viewer.setRootEditPart(new ScalableFreeformRootEditPart());
viewer.setKeyHandler(new Grap... | 0 |
[CLS] public void _testConvertIntoOneFile() {
File csvFile = new File("C:/DE311/solution_workspace/WorkbookTaglib/WorkbookTagDemoWebapp/src/main/resources/csv/google.csv");
try {
Charset guessedCharset = com.glaforge.i18n.io.CharsetToolkit.guessEncoding(csvFile, 4096);
CSVReader ... | 1 |
[CLS] public void actionPerformed(java.awt.event.ActionEvent e) {
JFileChooser fc = new JFileChooser();
fc.addChoosableFileFilter(new ImageFilter());
fc.setFileView(new ImageFileView());
fc.setAccessory(new ImagePreview(fc));
... | 1 |
[CLS] @Override
public void doHandler(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
if (request.getRequestURI().indexOf(".swf") != -1) {
String fullUrl = (String) request.getAttribute("fullUrl");
fullUrl = urlTools.urlFilter(fullUrl,... | 0 |
[CLS] @Test
public void testCopy_inputStreamToOutputStream_IO84() throws Exception {
long size = (long) Integer.MAX_VALUE + (long) 1;
InputStream in = new NullInputStreamTest(size);
OutputStream out = new OutputStream() {
@Override
public void write(int b) throws IOE... | 1 |
[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... | 1 |
[CLS] public String useService(HashMap<String, String> input) {
String output = "";
if (input.size() < 1) {
return "";
}
String data = "";
try {
for (String key : input.keySet()) {
data += "&" + URLEncoder.encode(key, "UTF-8") + "=" + URLEn... | 1 |
[CLS] public static void copyFile(String inputFile, String outputFile) throws IOException {
FileInputStream fis = new FileInputStream(inputFile);
FileOutputStream fos = new FileOutputStream(outputFile);
for (int b = fis.read(); b != -1; b = fis.read()) fos.write(b);
fos.close();
... | 0 |
[CLS] private void zip(FileHolder fileHolder, int zipCompressionLevel) {
byte[] buffer = new byte[BUFFER_SIZE];
int bytes_read;
if (fileHolder.selectedFileList.size() == 0) {
return;
}
File zipDestFile = new File(fileHolder.destFiles[0]);
try {
Zip... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.