Tuesday, January 16, 2007
Where To Buy Tire Chains In Vancouver
Lee getResource ()
This example shows how to read a text file using "getResource ()." For those already used getResource and collided with the problem by showing the path they came out something like this:
/ c: / Program% 20Files / ...
The idea to be taken into account is that the addresses "URL" does not contain spaces, so are stream replaces the character "% 20", this will repair the path using replaceAll ("% 20", "")
.
Note: The example shown here reads the file "getTextResource.java" and it shows.
I hope and will be useful.
import java.io. *;
import java.net .*;
/ *
* * @ author Oscar Hurtado Morato
* * /
getTextResource {public class public
getTextResource () {
}
public static void main(String[] arg) {
try{
getTextResource ex=new getTextResource();
ex.leeArchivo();
}
catch(Exception e){
e.printStackTrace();
}
}
public void leeArchivo()throws IOException {
URL url=this.getClass().getResource("getTextResource.java");
String path=url.getPath();
path=path.replaceAll("%20"," ");
System.out.println(path);
/ / read the file
BufferedReader br = new BufferedReader (new FileReader (path));
thisLine String = "";
retDoc String = "";
while ((thisLine = br.readLine ())! = null) {
thisLine retDoc = retDoc + + "\\ n";}
System.out.println (retDoc)
}}
Friday, January 12, 2007
New Revlon Foundation 2010
Errors Installing Apache 2 on solaris 10
APACHE 2 ON SOLARIS 10.
APACHE 2 ON SOLARIS 10.
[alert] (22) Invalid argument: setgid: unable to set group id to Group 4294967295 If this error occurs, enter the configuration file "httpd.conf" and change the line Group # -1 "to" Group nobody ", then re-start apache.
Subscribe to:
Posts (Atom)