Win a copy of Spring Boot in Practice this week in the Spring forum!

uniojn qoifazy

Greenhorn
+ Follow
since Dec 14, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by uniojn qoifazy

now , i import commons-httpclient.jar

but still get 5 error msg as follow,

Cannot instantiate the type HttpClient
DefaultHttpMethodRetryHandler cannot be resolved to a type
HttpMethodParams cannot be resolved to a variable
The method executeMethod(GetMethod) is undefined for the type HttpClient
The method getParams() is undefined for the type GetMethod


I would greatly appreciate it if you kindly give me some feedback on this
i have import org.apache.http.client.HttpClient;
isn't it ?
hi all,
i tried to connect my router and tried to run the sample code:





I got this error in the console -
HttpClient cannot be resolved to a type
GetMethod cannot be resolved to a type
UsernamePasswordCredentials cannot be resolved to a type

Any ideas what I'm doing wrong?
hi all,
is it possible to to get router status (up or down) in java ?
Can anyone give some examples of this ?



I would greatly appreciate it if you kindly give me some feedback on this
hi Charles Hargrave
i have try to using your method , but still can't get the command results by java
for "-f 5" is mean the output data type and the option is 5 from flow-print
i try to using other option for -f , and the output data is less than "-f 5 ",
so , i think the problem is like you said , generates a lot of screen output, it can fill up the the stderr and stdout streams and cause the process to lock up.
am i wrong ? do you have any idea to solve the problem ?
10 years ago

Charles Hargrave wrote:At the risk of asking a silly question, is there any flow-print command line option for specifying an input file? Is it really required that you use the redirect?

If you have to pipe the file content into the command, there's probably a Java class that can handle that (never used it myself though).

I still think the easiest option would be to put the UNIX commands inside a UNIX shell script and have it accept a parameter for the input file's name (to be used in the UNIX command).

Oh well, it's late. If I think of anything else, I'll post again.
CNH


hi Charles Hargrave ,
it's need to use the redirect (<) to input file ,
and

it's work in java , but when i add "-f 5"


it's failed ,
so , i think Java class that can handle redirect (<) , but i don't know why can't add more parameter (-f 5 ) ??
10 years ago

hi Chuck Buche ,
i have follow your code to modify my code ,

but it's can't work and get some error msg as follows :
java.io.IOException: Broken pipe
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(FileOutputStream.java:297)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:121)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:220)
at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:281)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:124)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:112)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:194)
at flowtest.main(flowtest.java:35)


please anyone can help me ?

thanks ,
10 years ago
hi all,



it's just my code , but I can not seem to get it to work. Do I need to do something else or is there a better way.
but if i don't add "-f 5 " to cmdlinux[2] = "/usr/bin/flow-print -f 5 <"+path; , it's will work successful ,
anyone can tell me why ? how to add the parameters "-f 5 " ?

thanks,
unioj
10 years ago
hi all,
i have a binary file that are netflow version 5 record,
anyone can tell me how to parse and print out the data by java ?