|
I think Collections is a implementation class not an interface where all the following methods implemented.
sort,binarysearch,max,min,emptyList,emptySet,etc....
Collection is an super interface for all the interfaces Set,List,Map..
|
|
|
|
|
Use LinkedList from Java Collection Framework like in the following:
// create your class
public class MyItem {
.......
........
}
//Instantiate your object
MyItem item = new MyItem();
List<myitem> myList = new LinkedList<myitem>();
myList.add(item);
|
|
|
|
|
how to call webservice in java using javascript with example link
|
|
|
|
|
You need to provide a lot more detail of your problem. Alternatively a bit of Google searching will most likely yield some useful information.
Use the best guess
|
|
|
|
|
Uum..... i kinda need help on deal on makin animation using java
Stifler
|
|
|
|
|
So are you expecting us to guess what kind of help?
Use the best guess
|
|
|
|
|
Uhm, you probably should start with this[^]
|
|
|
|
|
What kind of animation you need.
Regards
Shubhashish
|
|
|
|
|
Hello,
When i am encrypting a string (One way hashed) using SHA algorithm, the output differs from two different platforms.
When done in windows, an extra CR (CR LF) character is appearing but when done in linux box only LF character is appearing in between the output encrypted value.
FYI - CR (enter) LF(Space)
This leading me with issues in further process of application.
Kindly help for the same
Gowthami
|
|
|
|
|
This has nothing to do with encryption. The CR LF sequence is set in Windows wherever the output string of a printf() format contains the \n control. In linux (and UNIX) it is replaced with a single LF .
Use the best guess
|
|
|
|
|
No it is not about the last character of string.
see for example if i do one way hash for '1234567890127866'
have a look on the outputs
Windows:
+zWcE7pR4k97ysyi54WS4G6J1Qjfp/tXllE23mMLCFBrIONMlrXyMw9aF1UCFKCFjbcz0Yzge78u(THIS IS THE PLACE WHERE I M GETTING CR LF)Usye+/4Ulw==
Linux:
+zWcE7pR4k97ysyi54WS4G6J1Qjfp/tXllE23mMLCFBrIONMlrXyMw9aF1UCFKCFjbcz0Yzge78u(THIS IS THE PLACE WHERE I M GETTING ONLY LF)Usye+/4Ulw==
which means the whole characters represents single string
Regards
Gowthami
|
|
|
|
|
I have just tried the same test and get a completely different result ([B@1748ba4 ), so I can only assume that there is some more information that you have not given us.
Use the best guess
|
|
|
|
|
meaning?? have you tried to encrypt the string in both windows and linux??
md = MessageDigest.getInstance("SHA-512");
md.update(plaintext.getBytes("UTF-8"));
byte raw[] = md.digest();
String hash = (new BASE64Encoder()).encode(raw);
return hash;
This is what I have used to encrypt
|
|
|
|
|
saigowthami wrote: meaning?? Meaning that all you showed us was the source data and the resulting hash value, we had no idea what code you had used.
Use the best guess
|
|
|
|
|
Ya i have posted my code in my previous reply itself
|
|
|
|
|
I cannot find BASE64Encoder so cannot try recreating your problem. However, as Bernhard explained in this response[^], these extra line terminators are added when you convert the data to a string. Keep it as a byte[] and see if you still have the problem.
Use the best guess
|
|
|
|
|
|
ok but my database is in linux machine, where the strings encrypted and saved to database,
while i m running the same encryption util in linux the output is not matching with the database one.
Meanwhile both places the code is same to encrypt the string.
|
|
|
|
|
Look:
- before you store the value in the database, remove all newlines.
- before you compare a value with a value from the db, remove all newlines.
That works.
Of course, you have to update your databse in case that you have some entries there already.
|
|
|
|
|
Hello,
I am trying to code an application, like sync operation between two machines to transfer the files and folders through internet. Is it possible to use ftp or any other in java and write the application?
Regards
Gowthami
|
|
|
|
|
It's definitely possible. You can use FTP server on one machine and use a java program to synchronize a local folder with remote folder on FTP server. The FTP Server must be accessible from internet.
Other way is to write your own socket server implementation and use it for synchronization. Unlike the first implementation, this will allow you to initiate synchronization from either machine. With first it will be always from the machine on which java program is running.
Regards,
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
|
ya i used the socket programming only with two applications, client and server and transferred successfully... Thank you for the reply!!!
|
|
|
|
|
Hi Gowthami,
I am writing the java application for encryption/compression which will be integerated in spring batch application to transfer large files.once it is done i will upload the source code here.
|
|
|
|
|
|
Ho All,
I'm creating a TCP server with which I'll receive few strings.
First a file path
Second a message
Third another message
My code is:
String str;
while ((str = rd.readLine()) != null) {
System.out.println(str);
String file = str.toString();
.
.
.
.
.
while(something)
{
while(something new)
{
if(str.equalsignorecase("Google"))
{
System.out.print("My Yahoo");
}
else if(str.equalsignorecase("yahoo"))
{
System.out.print(My Google);
}
}
}
}
rd.close();
socket.close();
In this program, I'm able to access the first string but not getting the second string on
server.
How can I use
String str
multiple times sent by a TCP client?
Thanks!
|
|
|
|