text string | label int64 |
|---|---|
[CLS] public MeetingScript getScript(Integer id) {
MeetingScript script = null;
try {
URL url = new URL(SCRIPT_URL + "?script=" + id);
ObjectInputStream ois = new ObjectInputStream(url.openStream());
script = (MeetingScript) ois.readObject();
ois.close();
... | 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 =... | 0 |
[CLS] public static URLConnection openRemoteDescriptionFile(String urlstr) throws MalformedURLException {
URL url = new URL(urlstr);
try {
URLConnection conn = url.openConnection();
conn.connect();
return conn;
} catch (Exception e) {
Config conf =... | 0 |
[CLS] public void runDynusT() {
final String[] exeFiles = new String[] { "DynusT.exe", "DLL_ramp.dll", "Ramp_Meter_Fixed_CDLL.dll", "Ramp_Meter_Feedback_CDLL.dll", "Ramp_Meter_Feedback_FDLL.dll", "libifcoremd.dll", "libmmd.dll", "Ramp_Meter_Fixed_FDLL.dll", "libiomp5md.dll" };
final String[] modelFiles ... | 1 |
[CLS] public String hash(String senha) {
String result = "";
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(senha.getBytes());
byte[] hashMd5 = md.digest();
for (int i = 0; i < hashMd5.length; i++) result += Integer.toHexString((((has... | 0 |
[CLS] private File copyFromURL(URL url, String dir) throws IOException {
File urlFile = new File(url.getFile());
File dest = new File(dir, urlFile.getName());
logger.log("Extracting " + urlFile.getName() + " to " + dir + "...");
FileOutputStream os = new FileOutputStream(dest);
I... | 0 |
[CLS] protected void copyAndDelete(final URL _src, final long _temp) throws IOException {
final File storage = getStorageFile(_src, _temp);
final File dest = new File(_src.getFile());
FileChannel in = null;
FileChannel out = null;
if (storage.equals(dest)) {
return;
... | 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));
... | 1 |
[CLS] private static InputStream connect(final String url) throws IOException {
InputStream in = null;
try {
final URLConnection conn = new URL(url).openConnection();
conn.setConnectTimeout(YahooGeocoding.connectTimeOut);
conn.setReadTimeout(YahooGeocoding.readTimeOut... | 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 void copyJarContent(File jarPath, File targetDir) throws IOException {
log.info("Copying natives from " + jarPath.getName());
JarFile jar = new JarFile(jarPath);
Enumeration<JarEntry> entries = jar.entries();
while (entries.hasMoreElements()) {
JarEntry file = en... | 1 |
[CLS] public void handle() {
FileChannel srcChannel, destChannel;
String destOutFile = databaseName + ".script." + System.currentTimeMillis();
String destOutFileCompressed = databaseName + ".script." + System.currentTimeMillis() + ".gz";
if (rotateDest != null) {
... | 1 |
[CLS] public String encryptStringWithKey(String to_be_encrypted, String aKey) {
String encrypted_value = "";
char xdigit[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
MessageDigest messageDigest;
try {
messageDigest = MessageDigest.ge... | 0 |
[CLS] @SuppressWarnings("null")
public static void copyFile(File src, File dst) throws IOException {
if (!dst.getParentFile().exists()) {
dst.getParentFile().mkdirs();
}
dst.createNewFile();
FileChannel srcC = null;
FileChannel dstC = null;
try {
... | 0 |
[CLS] private static void unzipEntry(ZipFile zipfile, ZipEntry entry, File outputDir) throws IOException {
if (entry.isDirectory()) {
createDir(new File(outputDir, entry.getName()));
return;
}
File outputFile = new File(outputDir, entry.getName());
if (!outputFile... | 1 |
[CLS] public static void main(String[] args) throws Exception {
String uri = args[0];
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(URI.create(uri), conf);
FSDataInputStream in = null;
try {
in = fs.open(new Path(uri));
IOUtils.c... | 0 |
[CLS] private ArrayList execAtParentServer(ArrayList paramList) throws Exception {
ArrayList outputList = null;
String message = "";
try {
HashMap serverUrlMap = InitXml.getInstance().getServerMap();
Iterator it = serverUrlMap.keySet().iterator();
while (it.ha... | 0 |
[CLS] public void readEntry(String name, InputStream input) throws Exception {
File file = new File(this.directory, name);
OutputStream output = new BufferedOutputStream(FileUtils.openOutputStream(file));
try {
org.apache.commons.io.IOUtils.copy(input, output);
... | 1 |
[CLS] public Program updateProgramPath(int id, String sourcePath) throws AdaptationException {
Program program = null;
Connection connection = null;
Statement statement = null;
ResultSet resultSet = null;
try {
String query = "UPDATE Programs SET " + "sourcePath = '" ... | 0 |
[CLS] public final boolean login(String user, String pass) {
if (user == null || pass == null) return false;
connectionInfo.setData("com.tensegrity.palojava.pass#" + user, pass);
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(pass.getBytes());
... | 1 |
[CLS] @Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
req.setCharacterEncoding("UTF-8");
resp.setContentType(req.getContentType());
IOUtils.copy(req.getReader(), resp.getWriter());
} [SEP] public static void copyF... | 1 |
[CLS] public static void copy(File fromFile, File toFile) throws IOException {
if (!fromFile.exists()) throw new IOException("FileCopy: " + "no such source file: " + fromFile.getName());
if (!fromFile.isFile()) throw new IOException("FileCopy: " + "can't copy directory: " + fromFile.getName());
... | 0 |
[CLS] @SuppressWarnings("unchecked")
public void handle(Map<String, Object> data, String urlPath) {
try {
URL url = new URL(urlPath);
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream(), "utf-8"));
String line = null;
CMGroup curr... | 0 |
[CLS] public static byte[] readUrl(URL url) {
BufferedInputStream in = null;
try {
class Part {
byte[] partData;
int len;
}
in = new BufferedInputStream(url.openStream());
LinkedList<Part> parts = new LinkedList<Part>();
... | 0 |
[CLS] public String getMediaURL(String strLink) {
try {
String res = de.nomule.mediaproviders.KeepVid.getAnswer(strLink, "aa");
if (NoMuleRuntime.DEBUG) System.out.println(res);
String regexp = "http:\\/\\/[^\"]+\\/get_video[^\"]+";
Pattern p = Pattern.compile(reg... | 0 |
[CLS] protected synchronized String encryptThis(String seed, String text) throws EncryptionException {
String encryptedValue = null;
String textToEncrypt = text;
if (seed != null) {
textToEncrypt = seed.toLowerCase() + text;
}
try {
MessageDigest md = Mess... | 0 |
[CLS] @Override
public RServiceResponse execute(final NexusServiceRequest inData) throws NexusServiceException {
final RServiceRequest data = (RServiceRequest) inData;
final RServiceResponse retval = new RServiceResponse();
final StringBuilder result = new StringBuilder("R service call resul... | 1 |
[CLS] public boolean saveVideoXMLOnWebserver() {
String text = "";
boolean erg = false;
try {
URL url = new URL("http://localhost:8080/virtPresenterVerwalter/videofile.jsp?id=" + this.getId());
HttpURLConnection http = (HttpURLConnection) url.openConnection();
... | 1 |
[CLS] boolean copyFileStructure(File oldFile, File newFile) {
if (oldFile == null || newFile == null) return false;
File searchFile = newFile;
do {
if (oldFile.equals(searchFile)) return false;
searchFile = searchFile.getParentFile();
} while (searchFile != null);... | 1 |
[CLS] public static String hexMD5(String value) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
messageDigest.reset();
messageDigest.update(value.getBytes("utf-8"));
byte[] digest = messageDigest.digest();
return byteToHexString... | 0 |
[CLS] @Test
public void testCopy_readerToOutputStream() throws Exception {
InputStream in = new ByteArrayInputStream(inData);
in = new YellOnCloseInputStreamTest(in);
Reader reader = new InputStreamReader(in, "US-ASCII");
ByteArrayOutputStream baout = new ByteArrayOutputStream();
... | 1 |
[CLS] public static Board readStream(InputStream is) throws IOException {
StringWriter stringWriter = new StringWriter();
IOUtils.copy(is, stringWriter);
String s = stringWriter.getBuffer().toString();
Board board = read(s);
return board;
} [SEP] @Override
public Download... | 1 |
[CLS] public void insertRealm(final List<NewRealms> newRealms) {
try {
connection.setAutoCommit(false);
new ProcessEnvelope().executeNull(new ExecuteProcessAbstractImpl(connection, false, false, true, true) {
@Override
public void executeProcessReturnNull... | 0 |
[CLS] public static String encriptarContrasena(String contrasena) throws NoSuchAlgorithmException, UnsupportedEncodingException {
StringBuffer sb = new StringBuffer();
MessageDigest md = MessageDigest.getInstance("SHA-512");
md.update(contrasena.getBytes("UTF-8"));
byte[] digestBytes = m... | 0 |
[CLS] public void copyAffix(MailAffix affix, long mailId1, long mailId2) throws Exception {
File file = new File(this.getResDir(mailId1) + affix.getAttachAlias());
if (file.exists()) {
File file2 = new File(this.getResDir(mailId2) + affix.getAttachAlias());
if (!file2.exists()) {... | 0 |
[CLS] public static void copyFile(String fileName, String dstPath) throws IOException {
FileChannel sourceChannel = new FileInputStream(fileName).getChannel();
FileChannel destinationChannel = new FileOutputStream(dstPath).getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), destinati... | 1 |
[CLS] private static void copyFile(File inputFile, File outputFile) throws IOException {
FileReader in = new FileReader(inputFile);
FileWriter out = new FileWriter(outputFile);
int c;
while ((c = in.read()) != -1) out.write(c);
in.close();
out.close();
} [SEP] public ... | 1 |
[CLS] protected void innerProcess(ProcessorURI curi) throws InterruptedException {
Pattern regexpr = curi.get(this, STRIP_REG_EXPR);
ReplayCharSequence cs = null;
try {
cs = curi.getRecorder().getReplayCharSequence();
} catch (Exception e) {
curi.getNonFatalFailur... | 0 |
[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_THUMBNAI... | 0 |
[CLS] private static void generateTIFF(Connection con, String category, String area_code, String topic_code, String timeseries, String diff_timeseries, Calendar time, String area_label, String raster_label, String image_label, String note, Rectangle2D bounds, Rectangle2D raster_bounds, String source_filename, String di... | 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 String readFromURL(String urlStr) throws IOException {
URL url = new URL(urlStr);
StringBuilder sb = new StringBuilder();
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String inputLine;
while ((inputLine = in.readLine()) != n... | 0 |
[CLS] @Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String cacheName = req.getParameter("cacheName");
if (cacheName == null || cacheName.equals("")) {
resp.getWriter().println("parameter cacheName required");
... | 0 |
[CLS] public static void copy(File file1, File file2) throws IOException {
FileReader in = new FileReader(file1);
FileWriter out = new FileWriter(file2);
int c;
while ((c = in.read()) != -1) out.write(c);
in.close();
out.close();
} [SEP] public Set<Plugin<?>> loadPlug... | 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 URLStream(URL url) throws IOException {
this.url = url;
this.conn = this.url.openConnection();
contentType = conn.getContentType();
name = url.toExternalForm();
size = new Long(conn.getContentLength());
sourceInfo = "url";
} [S... | 0 |
[CLS] public void connect() throws ClientProtocolException, IOException {
HttpResponse httpResponse = httpClient.execute(httpGet);
HttpEntity entity = httpResponse.getEntity();
inputStream = entity.getContent();
Header contentEncodingHeader = entity.getContentEncoding();
if (cont... | 0 |
[CLS] public void fileCopy(File inFile, File outFile) {
try {
FileInputStream in = new FileInputStream(inFile);
FileOutputStream out = new FileOutputStream(outFile);
int c;
while ((c = in.read()) != -1) out.write(c);
in.close();
out.close()... | 1 |
[CLS] String connect() throws IOException {
String reply = null;
if (ftp == null) {
FTPClient ftp = new FTPClient();
ftp.connect(remote);
if (!FTPReply.isPositiveCompletion(ftp.getReplyCode())) {
throw new IOException("Connection failed: " + remote);
... | 0 |
[CLS] @Override
public void render(IContentNode contentNode, Request req, Response resp, Application app, ServerInfo serverInfo) {
Node fileNode = contentNode.getNode();
try {
Node res = fileNode.getNode("jcr:content");
if (checkLastModified(res, req.getServletRequset(), resp... | 1 |
[CLS] public static void main(String[] args) throws IOException {
ServerSocket serverSocket = null;
try {
serverSocket = new ServerSocket(4444);
} catch (IOException e) {
System.err.println("Could not listen on port: 4444.");
System.exit(1);
}
... | 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] 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 static boolean doPost(String urlString, Map<String, String> nameValuePairs) throws IOException {
URL url = new URL(urlString);
URLConnection conn = url.openConnection();
conn.setDoOutput(true);
PrintWriter out = new PrintWriter(conn.getOutputStream());
boolean first ... | 0 |
[CLS] private String fetch(String urlstring) {
String content = "";
try {
URL url = new URL(urlstring);
InputStream is = url.openStream();
BufferedReader d = new BufferedReader(new InputStreamReader(is));
String s;
while (null != (s = d.readLin... | 1 |
[CLS] public static int convertImage(InputStream is, OutputStream os, String command) throws IOException, InterruptedException {
if (logger.isInfoEnabled()) {
logger.info(command);
}
Process p = Runtime.getRuntime().exec(command);
ByteArrayOutputStream errOut = new ByteArrayO... | 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] @Override
public boolean exists() {
if (local_file.exists()) {
return true;
} else {
try {
URLConnection c = remote_url.openConnection();
try {
c.setConnectTimeout(CIO.getLoadingTimeOut(... | 0 |
[CLS] public static boolean copy(File source, File target) {
try {
if (!source.exists()) return false;
target.getParentFile().mkdirs();
InputStream input = new FileInputStream(source);
OutputStream output = new FileOutputStream(target);
byte[] buf = ne... | 1 |
[CLS] private static boolean hasPackageInfo(URL url) {
if (url == null) return false;
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(url.openStream()));
String line;
while ((line = br.readLine()) != null) {
if (li... | 1 |
[CLS] protected int authenticate(long companyId, String login, String password, String authType, Map headerMap, Map parameterMap) throws PortalException, SystemException {
login = login.trim().toLowerCase();
long userId = GetterUtil.getLong(login);
if (authType.equals(CompanyImpl.AUTH_TYPE_EA)) ... | 1 |
[CLS] private static List retrieveQuotes(Report report, Symbol symbol, String suffix, TradingDate startDate, TradingDate endDate) throws ImportExportException {
List quotes = new ArrayList();
String URLString = constructURL(symbol, suffix, startDate, endDate);
EODQuoteFilter filter = new YahooEO... | 0 |
[CLS] public static void copyFile(final File in, final File out) throws IOException {
final FileChannel sourceChannel = new FileInputStream(in).getChannel();
final FileChannel destinationChannel = new FileOutputStream(out).getChannel();
sourceChannel.transferTo(0, sourceChannel.size(), destinati... | 1 |
[CLS] public void deleteType(String id) throws Exception {
String tmp = "";
PreparedStatement prepStmt = null;
try {
if (id == null || id.length() == 0) throw new Exception("Invalid parameter");
con = database.getConnection();
String delType = "delete from typ... | 0 |
[CLS] public void truncateLog(long finalZxid) throws IOException {
long highestZxid = 0;
for (File f : dataDir.listFiles()) {
long zxid = isValidSnapshot(f);
if (zxid == -1) {
LOG.warn("Skipping " + f);
continue;
}
if (zxid ... | 0 |
[CLS] public boolean receiveFile(FileDescriptor fileDescriptor) {
try {
byte[] block = new byte[1024];
int sizeRead = 0;
int totalRead = 0;
File dir = new File(Constants.DOWNLOAD_DIR + fileDescriptor.getLocation());
if (!dir.exists()) {
... | 1 |
[CLS] public static String hash(String text) throws Exception {
StringBuffer hexString;
MessageDigest mdAlgorithm = MessageDigest.getInstance("MD5");
mdAlgorithm.update(text.getBytes());
byte[] digest = mdAlgorithm.digest();
hexString = new StringBuffer();
for (int i = 0;... | 0 |
[CLS] private void copy(File source, File target) throws IOException {
FileChannel in = (new FileInputStream(source)).getChannel();
FileChannel out = (new FileOutputStream(target)).getChannel();
in.transferTo(0, source.length(), out);
in.close();
out.close();
} [SEP] @Overrid... | 1 |
[CLS] public static String Sha1(String s) {
try {
MessageDigest md = MessageDigest.getInstance("SHA-1");
byte[] hash = new byte[40];
md.update(s.getBytes("iso-8859-1"), 0, s.length());
hash = md.digest();
return toHex(hash);
} catch (Exception ... | 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] void shutdown(final boolean unexpected) {
if (unexpected) {
log.warn("S H U T D O W N --- received unexpected shutdown request.");
} else {
log.info("S H U T D O W N --- start regular shutdown.");
}
if (this.uncaughtException != null) {
l... | 1 |
[CLS] public static 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);
... | 0 |
[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... | 1 |
[CLS] public static void copyFile(File sourceFile, File destFile) throws IOException {
if (!destFile.exists()) {
destFile.createNewFile();
}
FileChannel source = null;
FileChannel destination = null;
try {
source = new FileInputStream(sourceFile).getChanne... | 0 |
[CLS] public void launchJob(final String workingDir, final AppConfigType appConfig) throws FaultType {
logger.info("called for job: " + jobID);
MessageContext mc = MessageContext.getCurrentContext();
HttpServletRequest req = (HttpServletRequest) mc.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUES... | 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();
long size = in.size();
MappedByteBuffer bu... | 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 int unzipFile(File file_input, File dir_output) {
ZipInputStream zip_in_stream;
try {
FileInputStream in = new FileInputStream(file_input);
BufferedInputStream source = new BufferedInputStream(in);
zip_in_stream = new ZipInputStream(source);
... | 1 |
[CLS] private void appendArchive() throws Exception {
String cmd;
if (profile == CompilationProfile.UNIX_GCC) {
cmd = "cat";
} else if (profile == CompilationProfile.MINGW_WINDOWS) {
cmd = "type";
} else {
throw new Exception("Unknown cat equivalent fo... | 1 |
[CLS] public static String md5(String value) throws NoSuchAlgorithmException {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
try {
messageDigest.update(value.getBytes("UTF-8"));
} catch (UnsupportedEncodingException e) {
messageDigest.update(value.getByt... | 1 |
[CLS] private String fetchCompareContent() throws IOException {
URL url = new URL(compareTo);
StringWriter sw = new StringWriter();
IOUtils.copy(url.openStream(), sw);
return sw.getBuffer().toString();
} [SEP] protected String decrypt(final String data, final String key) throws Crypt... | 1 |
[CLS] public static void main(String[] args) throws IOException {
MSPack pack = new MSPack(new FileInputStream(args[0]));
String[] files = pack.getFileNames();
for (int i = 0; i < files.length; i++) System.out.println(i + ": " + files[i] + ": " + pack.getLengths()[i]);
System.out.println... | 0 |
[CLS] private OSD downloadList() throws IOException, IllegalStateException, ParseException, URISyntaxException {
OSD osd = null;
HttpClient client = new DefaultHttpClient();
HttpGet getMethod = new HttpGet(new URI(listUri));
try {
HttpResponse response = client.execute(getMet... | 0 |
[CLS] public FileInputStream execute() {
FacesContext faces = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) faces.getExternalContext().getResponse();
String pdfPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath("/pdf");
try... | 1 |
[CLS] public static boolean cpy(File a, File b) {
try {
FileInputStream astream = null;
FileOutputStream bstream = null;
try {
astream = new FileInputStream(a);
bstream = new FileOutputStream(b);
long flength = a.length();
... | 1 |
[CLS] public static void copyResourceToFile(Class owningClass, String resourceName, File destinationDir) {
final byte[] resourceBytes = readResource(owningClass, resourceName);
final ByteArrayInputStream inputStream = new ByteArrayInputStream(resourceBytes);
final File destinationFile = new File... | 1 |
[CLS] public Object construct() {
String fullName = lRegatta.getSaveDirectory() + lRegatta.getSaveName();
System.out.println(MessageFormat.format(res.getString("MainMessageBackingUp"), new Object[] { fullName + BAK }));
try {
FileInputStream fis = new ... | 1 |
[CLS] public Object mapRow(ResultSet rs, int i) throws SQLException {
Blob blob = rs.getBlob(1);
if (rs.wasNull()) return null;
try {
InputStream inputStream = blob.getBinaryStream();
if (length > 0) IOUtils.copy(inputStream, outputStream, offset, length); else IOUtils.co... | 1 |
[CLS] public void objectParserAssesmentItem(int file, int currentquestion, Resource resTemp) {
NodeList nl = null;
Node n = null;
NamedNodeMap nnp = null;
Node nsrc = null;
URL url = null;
String sFilename = "";
String sNewPath = "";
int indexLastSeparator... | 1 |
[CLS] public static boolean 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... | 0 |
[CLS] public void connected(String address, int port) {
connected = true;
try {
if (localConnection) {
byte key[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
si.setEncryptionKey(key);
} else {
saveData(address,... | 1 |
[CLS] public String postEvent(EventDocument eventDoc, Map attachments) {
if (eventDoc == null || eventDoc.getEvent() == null) return null;
if (queue == null) {
sendEvent(eventDoc, attachments);
return eventDoc.getEvent().getEventId();
}
if (attachments != null) {
... | 1 |
[CLS] static void copyFile(File file, File destDir) {
File destFile = new File(destDir, file.getName());
if (destFile.exists() && (!destFile.canWrite())) {
throw new SyncException("Cannot overwrite " + destFile + " because " + "it is read-only");
}
try {
FileInput... | 1 |
[CLS] public static String SHA1(String text) throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(text.getBytes());
byte byteData[] = md.digest();
StringBuffer sb = new StringBuffer();
for (int i = 0; i < byteData.length; i++) {
... | 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... | 0 |
[CLS] public Atividade insertAtividade(Atividade atividade) throws SQLException {
Connection conn = null;
String insert = "insert into Atividade (idatividade, requerente_idrequerente, datacriacao, datatermino, valor, tipoatividade, descricao, fase_idfase, estado) " + "values " + "(nextval('seq_atividade... | 1 |
[CLS] @Test
@Ignore
public void testToJson() throws IOException {
JsonSerializer js = new StreamingJsonSerializer(new ObjectMapper());
BulkOperation op = js.createBulkOperation(createTestData(10000), false);
IOUtils.copy(op.getData(), System.out);
} [SEP] public RSClassLoader(Map<Str... | 0 |
[CLS] protected Connection openRelativeFile(String file) throws IOException {
if (cachedBits == null) {
cachedBits = new ByteArray(url.openConnection().getInputStream()).getBytes();
}
ZipInputStream zin = new ZipInputStream(new ByteArrayInputStream(cachedBits));
ZipEntry zent... | 0 |
[CLS] public String encryptPassword(String clearPassword) throws NullPointerException {
MessageDigest sha;
try {
sha = MessageDigest.getInstance("SHA");
} catch (NoSuchAlgorithmException e) {
throw new NullPointerException("NoSuchAlgorithmException: " + e.toString());
... | 0 |
[CLS] public static void copyFile(File source, File destination) throws IOException {
BufferedInputStream in = new BufferedInputStream(new FileInputStream(source));
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(destination));
byte[] buffer = new byte[4096];... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.