|
Thanks a million, it has worked beautifully also with username. Thank you!
|
|
|
|
|
You are welcome.
"I'm neither for nor against, on the contrary." John Middle
|
|
|
|
|
|
I Need Java Compiler source code
|
|
|
|
|
|
install the JDK. and search for src file
"C:\Program Files\Java\jdk1.8.0_131\src.zip"
unzip the file and enjoy !!
|
|
|
|
|
I'm doing hibernate web app from this tutorial: https://www.javatpoi...-with-hibernate and when I run url http://localhost:8181/register/ I get 404 error. Files are like in tutorial.
Project structure looks like this:
click
|
|
|
|
|
|
Good day.
May I know how to add an image into a combox in netbeans?
Can help, please...
|
|
|
|
|
|
any one has idea about how to get memory usage of remote server using java?
|
|
|
|
|
Yes, you need an application on the server that collects the information and sends it to the client.
|
|
|
|
|
|
do you have alternate idea?
|
|
|
|
|
Such as what? You cannot capture information from a remote system unless that system first collects the information, and either lets you request it, or it sends it to you in some way.
|
|
|
|
|
Might want to clarify that other answer however since it actually depends on what the server is running.
A 'server' with java often means a JEE container. And most if not all of them have management APIs that allows access to usage statistics. So something like Tomcat, JBoss, WebLogic, etc might already have a way to get it via a http server or an API.
|
|
|
|
|
JDK provide tool to monitor the remote java application's memory use, here is where you can find the tool:
after you download the JDK, it will located in the tools directory.
|
|
|
|
|
can we find cpu utilization of server from client using sigar API?
|
|
|
|
|
What does the documentation say?
|
|
|
|
|
it has no method for get cpu utilization from client
Do you have any idea how to do?
|
|
|
|
|
|
|
Hi
I have a directory where log txt files are logged. Each log file has the following title date format 20180114.log, which is yyymmdd.
I want to search for data in the preceding file (date) so if the current date file is 20180114.log, I want to search the previous day 20180113.log, and then output the data i search for in anther text file.
How do I achieve this in java? any code examples I can follow?
I made a start by displaying the list of the files in the directory but could do with some help to achieve the above
public static void main(String[] args) {
File currentDir = new File("\\\\directory Path");
displayDirectoryContents(currentDir);
}
public static void displayDirectoryContents(File dir) {
try {
File[] files = dir.listFiles();
for (File file : files) {
System.out.println(" file:" + file.getCanonicalPath());
}
} catch (IOException e) {
e.printStackTrace();
}
}
thanks in advance
|
|
|
|
|
You can google using the following
java wildcard file search
|
|
|
|
|
You just need to list all files with the .log extension and find the last but one. So since array indices go from 0 to (count_of_entries - 1), the one at offset (count - 2) will be the last but one.
|
|
|
|