List() in java.io.file

Hallo everybody!
Can someone solve a little problem for me?
I want to list files and directories in a directory. If one of the files is a dirctory I want to put an "/" to the end of it. I works well if I list the current directory but not if I try to list a path like c:\temp.
Here is my code :
public class Lista {
//int i;
int i = 0;
//File Katalog;
// constructors
public Lista() {
usage();
public Lista(String[] l_files) {
list_files(l_files);
// methods
// method called if 1 argument is passed to main
private void list_files(String[] lf) {
// first check if katalog is a file
File katalog = new File(lf[0]);
// String c = new String(lf[1]);
if (katalog.isFile()) {
System.out.println(katalog + " is a file");
System.exit(1);
// check if katalog exists
if (katalog.exists()) {
String[] en_lista = katalog.list();
while (i < en_lista.length) {
File f = new File(en_lista);
if (f.isDirectory() == true) {
//if (f.isFile()) {
//f.getParent();
System.out.println(f + "/");
else {
System.out.println(f);
i++;
else
System.out.println(katalog + " doesn't exist");
// method called if no or more than 1 argument are passed to main
private void usage() {
System.out.println("\nusage : " + "\njava Lista directory");
System.exit(0);
public static void main(String[] args) {
// depending on the number of arguments passed to main different constructors are called
if (args.length < 1 || args.length > 2) {
new Lista();
else if (args.length == 1) {
new Lista(args);

**** example 1 ******
Here it works as I want it to do
java Lista . givs the output
directory/ (the slash mark that it is a directory)
Lista.class
Lista.java
**** example 2 ******
If I list like below it doesn't work
java Lista c:\temp givs the output
directory
file.txt
(I want to have the slash in the end of the directory to mark it's a directory but it doesn't)

Similar Messages

  • Static lookup lists:read data from a Java *.properties file

    Hi
    i need to make static lookup lists i am using read data from a Java *.properties file
    i am using the Class "PropertyFileBasedLookupViewObjectImpl" that wrote by Steve Muench in ToyStore.
    but i need to use the default language for that i update the loadDataFromPropertiesFile()
    method to find the correct properties file
    String temp=Locale.getDefault().getLanguage();
    String propertyFile =
    getViewDef().getFullName().replace('.', '/')+"_"+temp+ ".properties";
    the problem:
    For English(TEST_en.properties) it is good and working
    For Arabic(TEST_ar.properties) read from correct file _ar.properties
    but the dispaly character is wrong
    When Debug
    In the File 1=&#1583;&#1605;&#1588;&#1602;
    In debug 1=/u32423

    Depending on your use case you can either use a programmatic VO or directly expose the JV class as a data control.
    http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_36/jdtut_11r2_36.html

  • java.io.File instance .list() not working properly

    i want to get the file, folders in any directory, so i used the File.list() method.
    but it is working in a peculiar manner. first see my simplified code, where the problem i am having::
    public class FileChildTest {
         public static void main(String[] args) {
              try{
                   String[] s=new java.io.File(args[0]).list();
                   for (int i = 0; i<s.length; i++){
                        System.out.println (s);
              catch(java.lang.Exception ex){
    now, say i saved it in c:\MyJava directory. now when i run it with cmd line argument c: in stead of listing the file/folders in c: drive it lists the file/folders of c:\MyJava directory. in any other case its working fine.
    now if i save the file in d:\MyJava\src. again it gives same problem when CLA is d: , but working fine for any other arg.
    now xplain me why is this happening. do i have any fault or what?
    and whats the solution.
    can ne1 pls.

    to b more scecific, in the 2nd case it lists the files/folders of d:\MyJava\src folder.

  • Values from a java archive file that uses Coherence are null

    This is essentially the details of my project.
    Check the values in andrew's coherence cluster.
    Checkign the values in the stats class.
    z:\javaclasses\stats.jar
    Some sample code:
    -- initialize
    /* start the stats class (the fields you want to look) */
    Stats.init(StatsField._1_DAY_HIGH, StatsField._1_DAY_LOW,
    StatsField.PREV_CLOSE);
    -- pulling data
    if (Stats.get(sSymbol).PREV_CLOSE != null) {
    fValue = Stats.get(sSymbol).PREV_CLOSE;
    -- in your .bat file (Before setting the classpaths)
    call z:\coherence\bin\prod_setup.bat
    set java_opts=%java_opts%
    -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    myclasspaths
    myclasspaths
    myclasspaths
    My bat file looks like this.
    call z:\coherence\bin\prod_setup.bat
    set java_opts=%java_opts% -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    cd \
    cd C:\Users\Dan\Documents\Documents_for_4th_Project
    SET PATH=%PATH%;Z:\jdk1.7.0\bin
    SET CLASSPATH=
    SET CLASSPATH=%CLASSPATH%;.
    SET CLASSPATH=%CLASSPATH%;z:\javaclasses\stats.jar
    SET CLASSPATH=%CLASSPATH%;Z:\coherence\lib3702\coherence.jar
    javac ValuesInStats.java
    java ValuesInStats
    pause
    My ValuesInStats.java looks like this below.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    //package ValuesInStats;
    import stats.*;
    import java.io.*;
    * @author Dan
    public class ValuesInStats
    * @param args the command line arguments
    private double dayHigh;
    private double dayLow;
    private double prevClose;
    public void startStatClass()
    Stats.init(StatsField._1_DAY_HIGH, StatsField._1_DAY_LOW, StatsField.PREV_CLOSE);
    public void pullDataFromStatClass()
    if (Stats.get("GOOG")._1_DAY_HIGH != null)
    dayHigh = Stats.get("GOOG")._1_DAY_HIGH;
    if (Stats.get("IBM")._1_DAY_LOW != null)
    dayLow = Stats.get("IBM")._1_DAY_LOW;
    if (Stats.get("SLB").PREV_CLOSE != null)
    prevClose = Stats.get("").PREV_CLOSE;
    public static void main(String[] args)
    ValuesInStats stat = new ValuesInStats();
    stat.startStatClass();
    stat.pullDataFromStatClass();
    try
    PrintWriter inputToFile = new PrintWriter(new BufferedWriter(new FileWriter("C:\\Users\\Dan\\Documents\\Documents_for_4th_Project\\DANS_StatReport.txt")));
    inputToFile.println(stat.dayHigh);
    inputToFile.println(stat.dayLow);
    inputToFile.println(stat.prevClose);
    inputToFile.close();
    catch(Exception e)
    e.getMessage();
    e.printStackTrace();
    The results i'm getting are included below.
    C:\Users\Dan\Documents\Documents_for_4th_Project>call z:\coherence\bin\prod_setup.bat
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM Call this batch file before setting any PATH or CP or JAVA_OPTS.
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM You can override anything you don't like afterwards.
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM
    C:\Users\Dan\Documents\Documents_for_4th_Project>title
    C:\Users\Dan\Documents\Documents_for_4th_Project>set JAVA_HOME=z:\jdk7
    C:\Users\Dan\Documents\Documents_for_4th_Project>set JAVA_EXE=z:\jdk7\bin\java_for_.exe
    C:\Users\Dan\Documents\Documents_for_4th_Project>set PATH=z:\jdk7\bin
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=1,2" %u in ('date /t') do set d=%v
    C:\Users\Dan\Documents\Documents_for_4th_Project>set d=10/11/2011
    C:\Users\Dan\Documents\Documents_for_4th_Project>set timestr=20111011
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=1,2,3 delims=: " %i in ('time /t') do set q=%i%j%k
    C:\Users\Dan\Documents\Documents_for_4th_Project>set q=1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>set datetime=20111011_1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>echo 20111011_1052AM
    20111011_1052AM
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM token=14 for vista, 15 for XP
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F "tokens=14,15" %a in ('c:\windows\system32\ipconfig | c:\windows\system32\findstr /R "Address.*XXX.XXX.X."') do (IF "%a" == ":" (set my_ip=%b ) ELSE (set my_ip=%a ) )
    C:\Users\Dan\Documents\Documents_for_4th_Project>(IF "XXX.XXX.X.XXX" == ":" (set my_ip= ) ELSE (set my_ip=XXX.XXX.X.XXX ) )
    IP=XXX.XXX.X.XXX
    C:\Users\Dan\Documents\Documents_for_4th_Project>for /F %i in ('z:\coherence\bin\getpid.exe') do set my_pid=%i
    C:\Users\Dan\Documents\Documents_for_4th_Project>set my_pid=1464
    C:\Users\Dan\Documents\Documents_for_4th_Project>IF /I "" == "OMS" goto OMS
    C:\Users\Dan\Documents\Documents_for_4th_Project>goto DONE
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM ---PROD---
    C:\Users\Dan\Documents\Documents_for_4th_Project>REM ---PROD---
    C:\Users\Dan\Documents\Documents_for_4th_Project>rem ==== COHERENCE ====
    C:\Users\Dan\Documents\Documents_for_4th_Project>rem ==== COHERENCE ====
    C:\Users\Dan\Documents\Documents_for_4th_Project>set java_opts= -Dtangosol.coherence.localhost=XXX.XXX.X.XXX -Dtangosol.coherence.distributed.localstorage=false -Dtangosol.coherence.member=Dan -Xms -Xmx -server -showversion -Djava.
    eferIPv4Stack=true -Dtangosol.coherence.log.level=3 -Dtangosol.coherence.log=z:\oms2\logs\.Dan.XXX.XXX.X.XXX.20111011_1052AM.log -Xloggc:z:\oms2\logs\.Dan.XXX.XXX.X.XXX.20111011_1052AM.gc -Dtangosol.pof.config=z:/coherence/pof-conf
    -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config.xml -Dtangosol.coherence.clusteraddress=255.0.0.1 -Dtangosol.coherence.clusterport=54321 -Dtangosol.coherence.cluster=oms_prod -Dtangosol.coherence.rack= -Dtangosol.cohere
    te=1464 -Dtangosol.coherence.cacheconfig=z:/coherence/cache-config-extend-client.xml
    C:\Users\Dan\Documents\Documents_for_4th_Project>cd \
    C:\>cd C:\Users\Dan\Documents\Documents_for_4th_Project
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET PATH=z:\jdk7\bin;Z:\jdk1.7.0\bin
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.;z:\javaclasses\stats.jar
    C:\Users\Dan\Documents\Documents_for_4th_Project>SET CLASSPATH=;.;z:\javaclasses\stats.jar;Z:\coherence\lib3702\coherence.jar
    C:\Users\Dan\Documents\Documents_for_4th_Project>javac ValuesInStats.java
    C:\Users\Dan\Documents\Documents_for_4th_Project>java ValuesInStats
    2011-10-11 10:52:21.299/2.277 Oracle Coherence 3.7.0.2 <Info> (thread=main, member=n/a): Loaded operational configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/tangosol-coherence.xml"
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <Info> (thread=main, member=n/a): Loaded operational overrides from "jar:file:/Z:/coherence/lib3702/coherence.jar!/tangosol-coherence-override-dev.xml"
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <D5> (thread=main, member=n/a): Optional configuration override "/tangosol-coherence-override.xml" is not specified
    2011-10-11 10:52:21.408/2.386 Oracle Coherence 3.7.0.2 <D5> (thread=main, member=n/a): Optional configuration override "/custom-mbeans.xml" is not specified
    Oracle Coherence Version 3.7.0.2 Build 25173
    Grid Edition: Development mode
    Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
    2011-10-11 10:52:22.625/3.603 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Loaded Reporter configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/reports/report-group.xml"
    2011-10-11 10:52:22.844/3.822 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Loaded cache configuration from "jar:file:/Z:/coherence/lib3702/coherence.jar!/coherence-cache-config.xml"
    2011-10-11 10:52:24.029/5.007 Oracle Coherence GE 3.7.0.2 <D4> (thread=main, member=n/a): TCMP bound to /XXX.XXX.X.XXX:8102 using SystemSocketProvider
    2011-10-11 10:52:24.560/5.538 Oracle Coherence GE 3.7.0.2 <Info> (thread=Cluster, member=n/a): This Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInSt
    uesInStats, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2) joined cluster "cluster:0x96AB" with senior Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=proces
    , Role=CoherenceConsole, Edition=Grid Edition, Mode=Development, CpuCount=2, SocketCount=2)
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=2, Timestamp=2011-10-07 14:15:44.572, Address=XXX.XXX.X.XXX:8090, MachineId=27506, Location=process:3904, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=3, Timestamp=2011-10-07 14:21:36.311, Address=XXX.XXX.X.XXX:8092, MachineId=27506, Location=process:628, Role=CoherenceConsole)
    Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=4, Timestamp=2011-10-07 14:21:50.655, Address=XXX.XXX.X.XXX:8094, MachineId=27506, Location=process:4212, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=5, Timestamp=2011-10-07 14:22:18.338, Address=XXX.XXX.X.XXX:8096, MachineId=27506, Location=process:5224, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=6, Timestamp=2011-10-07 14:23:41.229, Address=XXX.XXX.X.XXX:8098, MachineId=27506, Location=process:5608, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.591/5.569 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member(Id=7, Timestamp=2011-10-07 14:24:16.971, Address=XXX.XXX.X.XXX:8100, MachineId=27506, Location=process:5924, Role=CoherenceConsole)
    d Cluster with senior member 1
    2011-10-11 10:52:24.622/5.600 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.622/5.600 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 1 joined Service Management with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 2 joined Service Management with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 3 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.638/5.616 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 3 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 7 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 7 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 4 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 4 joined Service Management with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 5 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.653/5.631 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 5 joined Service Management with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 6 joined Service Cluster with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=n/a): Member 6 joined Service Management with senior member 1
    2011-10-11 10:52:24.669/5.647 Oracle Coherence GE 3.7.0.2 <Info> (thread=main, member=n/a): Started cluster Name=cluster:0x96AB
    Group{Address=224.3.7.0, Port=37000, TTL=4}
    MasterMemberSet
    ThisMember=Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInStatsValuesInStats)
    OldestMember=Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=process:1632, Role=CoherenceConsole)
    ActualMemberSet=MemberSet(Size=8, BitSetCount=2
    Member(Id=1, Timestamp=2011-10-07 14:15:01.108, Address=XXX.XXX.X.XXX:8088, MachineId=27506, Location=process:1632, Role=CoherenceConsole)
    Member(Id=2, Timestamp=2011-10-07 14:15:44.572, Address=XXX.XXX.X.XXX:8090, MachineId=27506, Location=process:3904, Role=CoherenceConsole)
    Member(Id=3, Timestamp=2011-10-07 14:21:36.311, Address=XXX.XXX.X.XXX:8092, MachineId=27506, Location=process:628, Role=CoherenceConsole)
    Member(Id=4, Timestamp=2011-10-07 14:21:50.655, Address=XXX.XXX.X.XXX:8094, MachineId=27506, Location=process:4212, Role=CoherenceConsole)
    Member(Id=5, Timestamp=2011-10-07 14:22:18.338, Address=XXX.XXX.X.XXX:8096, MachineId=27506, Location=process:5224, Role=CoherenceConsole)
    Member(Id=6, Timestamp=2011-10-07 14:23:41.229, Address=XXX.XXX.X.XXX:8098, MachineId=27506, Location=process:5608, Role=CoherenceConsole)
    Member(Id=7, Timestamp=2011-10-07 14:24:16.971, Address=XXX.XXX.X.XXX:8100, MachineId=27506, Location=process:5924, Role=CoherenceConsole)
    Member(Id=9, Timestamp=2011-10-11 10:52:24.482, Address=XXX.XXX.X.XXX:8102, MachineId=27506, Location=process:5892, Role=ValuesInStatsValuesInStats)
    RecycleMillis=1200000
    RecycleSet=MemberSet(Size=0, BitSetCount=0
    TcpRing{Connections=[7]}
    IpMonitor{AddressListSize=0}
    2011-10-11 10:52:24.872/5.850 Oracle Coherence GE 3.7.0.2 <D5> (thread=Invocation:Management, member=9): Service Management joined the cluster with senior service member 1
    2011-10-11 10:52:25.871/6.849 Oracle Coherence GE 3.7.0.2 <D5> (thread=DistributedCache, member=9): Service DistributedCache joined the cluster with senior service member 9
    Stats init _1_DAY_HIGH
    Stats init _1_DAY_LOW
    Stats init PREV_CLOSE
    Stats.get() hm has null for GOOG
    Stats.get() hm has null for IBM
    Stats.get() hm has null for SLB
    2011-10-11 10:52:28.605/9.583 Oracle Coherence GE 3.7.0.2 <D4> (thread=ShutdownHook, member=9): ShutdownHook: stopping cluster node
    2011-10-11 10:52:28.620/9.598 Oracle Coherence GE 3.7.0.2 <D5> (thread=Cluster, member=9): Service Cluster left the cluster
    C:\Users\Dan\Documents\Documents_for_4th_Project>pause
    Press any key to continue . . .
    I'm not sure why I'm getting null values. Let me know if additional information is needed. Thanks!
    P.S. IP Addresses represent XXX.XXX.X.XXX for security purposes.

    Here's the details of the stat class from the stats.jar. Thanks!
    package stats;
    import java.lang.reflect.Field;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Set;
    public class Stats implements com.tangosol.util.MapListener, com.tangosol.net.MemberListener {
    public String SYMBOL;
    public String NAME;
    public String CUSIP;
    public Long POSITION_LIMIT;
    public Float YEAR_HIGH;
    public String NEWS_BUY_RATING;
    public String NEWS_SELL_RATING;
    public String NEWS_NOTES;
    public Long AVG_DAILY_VOLUME;
    public Float MARKET_CAP;
    public Float _1_DAY_GROUP_PERCENT_CHANGE;
    public String PRIMARY_GROUP;
    public String ZACKS_RANK;
    public String FUND_GRADE;
    public String CRAMER_CALL;
    public Float PREV_CLOSE;
    public Float KSLOW;
    public Float DSLOW;
    public Float _90_DAY_HIGH;
    public Float _90_DAY_LOW;
    public Float _90_DAY_PERCENT_OF_RANGE;
    public Float _52_WEEK_HIGH;
    public Float _52_WEEK_LOW;
    public Float _52_WEEK_PERCENT_OF_RANGE;
    public Date NEXT_EARNINGS_DATE;
    public String NEXT_EARNINGS_ANNOUNCEMENT_TIME;
    public Object OPENING_INDICATION;
    public oms.OrderExchange PRIMARY_EXCHANGE;
    public Float _1_DAY_PERCENT_CHANGED;
    public Float _1_DAY_PERCENT_CHANGED_TEST;
    public Float _1_DAY_HIGH;
    public Float _1_DAY_LOW;
    public Long POSTMARKET_VOLUME;
    public Long PREMARKET_VOLUME;
    public Float OPEN_PRICE;
    public Integer POSTMARKET_TRADES;
    public Integer PREMARKET_TRADES;
    public Float POSTMARKET_HIGH;
    public Float POSTMARKET_LOW;
    public Float PREMARKET_HIGH;
    public Float PREMARKET_LOW;
    public Float POSTMARKET_VOLUME_WEIGHTED_AVG_PRICE;
    public Float PREMARKET_VOLUME_WEIGHTED_AVG_PRICE;
    public Float POSTMARKET_AVG_PRICE;
    public Float PREMARKET_AVG_PRICE;
    public Boolean IS_OPEN_ON_NYSE;
    public Boolean IS_HALTED;
    public Integer NEWSWARE_STORY_COUNT;
    public Float _1_DAY_PERCENT_OF_RANGE;
    public Boolean IS_ETF;
    public Integer ROUND_LOT_SIZE;
    public Integer LOCATED_SHARES_AVAILABLE;
    public Boolean IS_OPTIONABLE;
    private static HashMap<String, Stats> hm;
    private static List<com.tangosol.net.NamedCache> subscribedCacheList;
    private static Stats INSTANCE;
    private Set<StatsUpdateListener> updateListenerSet;
    public Stats() {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberJoined(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberLeaving(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void memberLeft(com.tangosol.net.MemberEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public static Stats get(String string) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public static void init(StatsField[] sfs) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private static Field getField(com.tangosol.util.MapEvent me) throws NoSuchFieldException {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private void notifyUpdateListeners(Field field, Object o) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void addStatsUpdateListener(StatsUpdateListener sl) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void removeStatsUpdateListener(StatsUpdateListener sl) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    private void processInsertOrUpdate(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public synchronized void entryInserted(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public synchronized void entryUpdated(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    public void entryDeleted(com.tangosol.util.MapEvent me) {
    //compiled code
    throw new RuntimeException("Compiled Code");
    }

  • Getting all the members (variables, methods AND method bodies) of a java source file

    For a project I want to programmatically get access to the members of java source file (member variables, methods etc) as well as to the source code of those members. My question is what is the best method for this? So far I have found the following methods:
    Use AST's provided by the Java Source API and Java Tree API, as discussed in the following posts:
    http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6-compiler-apis.html
    http://weblogs.java.net/blog/timboudreau/archive/2008/02/see_java_code_t.html
    http://netbeans.dzone.com/announcements/new-class-visualization-module
    This has the disadvantage that the classes actually have to be compilable. When I look at the Netbeans Navigator view however, it provides me with a nicely formatted UI list, regardless of the "compilable" state of the class.
    Thus I started looking at how to do this... The answer appears to be through the use of tools such as JavaCC: https://javacc.dev.java.net/
    ANTLR: http://www.antlr.org/
    which are lexers and parsers of source code. However, since the Navigator panel already does this, couldn't I use part of this code to get me the list of variables and methods in a source file? Does the Navigator API help in this regard?
    Another route seems to be through tools such as
    BeautyJ: http://beautyj.berlios.de/
    which run on top of JavaCC if I am correct, and which has the ability to provide a clean view on your java code (or an XML view). However, BeautyJ does not seem to be too actively developed, and is only j2se1.4 compatible.
    I hope someone can shed a light on the best way to go about what I want to achieve. Somebody already doing this?
    (I crossposted on the Netbeans forums too, hope this is OK...)

    I'm currently developing a LaTeX editor(MDI) and I do the same thing, but I don't know what exactly do you need.

  • Java.io.File only returns similar file names

    I have written a bean which reads a directory and places the file names in an array, which can be accessed by a JSP page. At first, the files inside the directory were named wb_1.jsp, wb_2.jsp, wb_3.jsp and so on. When I change a filename to something like work.jsp, it still appears in the file list, but when I rename it to something like identify.jsp, it doesn't!
    If I count the array, it does read the correct number of files.
    Class FileHandler
    // Imports
    import java.io.File;
    // Class
    public class FileHandler
         // Constants and variables
         public File dir;
         public File[] files;
          * Returns the number of files found inside the given directory
         public int showFiles()
              try
                   setDir(getDir());     // Get file directory as set in the bean property
                   files = dir.listFiles();     // List the files found inside the directory
              catch (Exception e)
                   System.out.println(e + " : No files found to return a value");
              return files.length;      // Return the number of files
          * Returns the file name by using the in value in the files array
         public String returnFileName(int in)
              return files[in].getName();     // Return the name of the file
          * Sets dir file type to the setproperty value in
         public void setDir(File in)
              dir = in;     // Set class variable value for dir
          * Returns the dir value
         public File getDir()
              return dir;     // Return the setproperty value for dir
    }And the JSP code which reads the array
    out.println("<select onChange=\"jumpMenu('top',this,0)\" size=\"5\" style=\"width: 200\"");
    String fileName = new String();
    for(int x=0; x<file.showFiles(); x++)
         fileName = file.returnFileName(x);
         out.println("<option selected value=\"beheer.jsp?action=2&file=" +  fileName + "\">" +  fileName +"</option>");
    out.println("</select>");

    I forgot bean properties im the above code lines. Here it is, just in case.
    <jsp:useBean id="file" class="FileHandler" scope="page" />
    <jsp:setProperty name="file" property="dir" value="C:\\IBM Websphere workspace\\Project\\Web Content\\WEB-INF\\include" />

  • Can New Java 7 File API Path Objs Be Used For Windows Virtual Folders

    Hello,
    I'm trying to duplicate a JFileChooser's drop-down list containing root directories of the file system. For Windows machines, its combobox lists the roots in a nice tree-like layout. For example:
    + Desktop
      + Computer
        + Local Disk (C:)
        + Data (D:)I cannot find an offical way to do this; I ended up using a class called "ShellFolder" to do it. Based on the "File" objects returned by the "ShellFolder" operation, I wanted to use the "toPath" method of the "java.io.File" object to convert the object to a "java.io.file.Path" object. Unfortunately, when I try to convert it, a java.nio.file.InvalidPathException" occurs.
    Therefore, is there a way to use the the new Path object (provided by Java7's new File NIO APIs) that can map to Windows special virtual folders (like "My Computer" which is mapped to a CLSID like "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}")?
    Note: It looks like NetBeans suffered from the same problem. See their bug report here: [https://netbeans.org/bugzilla/show_bug.cgi?id=214011] .
    Here's some sample code to reproduce the problem:
    static public void main(final String[] asArguments)
         javax.swing.SwingUtilities.invokeLater(new Runnable() {
              @Override
              public void run()
                   java.io.File homeFile = FileSystemView.getFileSystemView().getHomeDirectory();
                   System.out.printf("File obj for home dir = %s\r\n", homeFile.getAbsolutePath());
                   java.nio.file.Path homePath = homeFile.toPath();
                   System.out.printf("Path obj for home dir = %s\r\n", homePath.toString());
                   // get the root directories
                   java.io.File[] rootDirs = (java.io.File[]) sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders");
                   for (int nIdx = 0; nIdx < rootDirs.length; nIdx++) {
                        java.io.File nextRoot = rootDirs[nIdx];
                        System.out.printf("File obj for next root dir = %s\r\n", nextRoot.getAbsolutePath());
                        // Is this a bug?
                        //          When we encounter a special Windows folder,
                        //          like "My Computer" which has a filename of "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}",
                        //          why do we receive a "java.nio.file.InvalidPathException"?  Should it not resolve the path
                        //          to the virtual Windows folder of "My Computer", just like the java.io.File objects do?
                        //          If not, is there an alternative way to get that information using the new Java 7 File APIs?
                        java.nio.file.Path nextRootPath = nextRoot.toPath();
                        System.out.printf("Path obj for next root dir = %s\r\n", nextRootPath.toString());
                   } // for
              } // run
    } // mainEdited by: RhinoGuy on Aug 10, 2012 11:11 AM

    Hmm don't know about special folders but the File object does have a listRoots() method. Perhaps that only returns mapped drives on Windows though, I remember using it to create my own Eclipse type filechooser which I find a lot more user-friendly than the standard JFileChooser.

  • How use java.io.File ?

    import java.io.File;
    public class test {
         void     help( String[] info ) {
              for ( int x = 0; x < info.length; x++ )
                   System.out.println( info[x] );
         public static void main( String[] args ) {
              test t = new test();
              t.help( args );
              File f = new File("args[0]");
              t.help( f.list() );
    }The File.list() return "String[]", but it no same for "String[] agrs". How to use File.list() ?

    Try doing File f = new File(args[0]);

  • Opening a java jar file through a labview program

    Hello,
    I need to open a java jar file in labview........this jar file is a GUI with multiple frames and has buttons on each frame help navigate through between frames....i just require the program to open it and close it based on some signals so then i won't have to do it manually

    LabVIEW doesn't have any control over what happens in a system exec, as you give the control to the system. You can, however, check the process list through .NET commands and kill the process (You should be able to stop it through "taskkill /F /im java.exe"). Not the prettiest solution, but should work.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Java Applet Files in RH8 Output

    Hello to everyone!
    My name is Livia, I am from Romania, and I work as a Technical Writer for a company that makes billing software for telecommunications providers. One of my tasks consists in creating WebHelp files for our web-based applications, and I have recently encountered a problem for which I need some expert advice.
    While investigating a recent bug (the help isn't working properly on the web application it's for), I have discovered that there are some Java-related files missing from my help output: webhelp.cab, webhelp.jar and whskin_papplet.htm. These files exist in older projects created with RH5. I now use RH8. The Adobe help page for RH 8 (At http://help.adobe.com/en_US/RoboHelp/8.0/RoboHTML/WS5b3ccc516d4fbf351e63e3d11aff59c2a0-7fb 6.html) lists these files as normally present in the output, and yet, in one of the discussion threads on this forum (http://forums.adobe.com/thread/24865), someone says "webhelp.jar is not being used in the output so you can safely remove it if required. It has been fixed in RH8 and doesn't come in the output."
    What is the correct version? Should these files appear in the help output or not?
    Thank you,
    Livia Miron

    Welcome to our community
    The files should not be present. They are not needed. They are (or were) related to the way the navigation pane works.
    In RoboHelp 7 and earlier, there was the following option in the WebHelp generation dialogs:
    As you can see, RoboHelp 8 does not offer this option:
    Hope this helps... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Help on java.io.File

    I need to know the time stamp of a file like "HelloWorld.java" or "ReadMe.txt".
    -My application requires to delete all those ".txt" files that's One-Day old. How will I know if that file is 1 day old????
    -cant find any methods on java.io.File in regards with that.
    any ideas/help would be greatly appreciated.
    Thanks

    Again, here's my problem, i dont know what's wrong with my code but everytime I check for a file, the entire date (year, month, day, hour,min, sec) is completely dead wrong...
    it always prints the year into 1970 instead of 2006...
    below is my a portion of my code:
    try {     
                  ResourceBundle rs=ResourceBundle.getBundle("directory");
                 String directory=rs.getString("dir");     
                   File fileDirectory=new File(directory+"/");
                   File file=null;
                   String listFiles[]=fileDirectory.list();
                   for (int i = 0; i<listFiles.length; i++){
                        System.out.println (listFiles);
                        file=new File(listFiles[i]);
                        //get file's date stamp
                   long dateStamp=file.lastModified();
                   GregorianCalendar dateOfFile=new GregorianCalendar();
                   dateOfFile.setTime(new Date(dateStamp));
    // it prints here 1970.... Why????          
         System.out.println ("year: "+ dateOfFile.get(Calendar.YEAR));
         System.out.println ("Month: "+ dateOfFile.get(Calendar.MONTH));
         System.out.println ("day: "+dateOfFile.get(Calendar.DAY_OF_MONTH));
         System.out.println ("Hour: "+dateOfFile.get(Calendar.HOUR_OF_DAY));
         System.out.println ("Min: "+dateOfFile.get(Calendar.MINUTE));
         System.out.println ("Sec: "+dateOfFile.get(Calendar.SECOND));

  • How to avoid directory listing in java web applications.

    how to avoid directory listing in java web applications.
    That is on typing the url of the application it should not the directory listing. Welcome tag in web.xml doesnot fully solve the problem, since still the images folder etc is still accessible

    I know of two ways.
    If you're using tomcat and have access to the conf directory.
    Edit your $TOMCAT/conf/web.xml. Find your default servlet properties and change
      <servlet>
        <servlet-name>default</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
          <param-name>debug</param-name>
          <param-value>0</param-value>
        </init-param>
        <init-param>
          <param-name>listings</param-name>
          <param-value>true</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>to  <servlet>
        <servlet-name>default</servlet-name>
        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
        <init-param>
          <param-name>debug</param-name>
          <param-value>0</param-value>
        </init-param>
        <init-param>
          <param-name>listings</param-name>
          <param-value>false</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>And restart your server. This will affect every directory on the server, and return a 405 directory browsing forbidden error.
    Another way, is to place an index.jsp inside each directory with a simple one line redirect to your applications CONTEXT_PATH.response.sendRedirect("http://yourserver/yourapp/");This will only affect specific directories which contain these index.jsp files.
    Hope this helps

  • How to run java jar file

    Hello,
    I got a java jar file which contains folders with class file. When I double click on the jar file, it gave a error
    Exception in thread "main" java.lang.NoClassDefFoundError
    How can I run this jar file?
    Thanks,
    CR

    Hello,
    I got a java jar file which contains folders with
    class file. When I double click on the jar file, it
    gave a error
    Exception in thread "main"
    java.lang.NoClassDefFoundError
    How can I run this jar file?
    Thanks,
    CR... and assuming that Jar contains a manifest file, what does it look like? I would guess that the Main-Class entry is incorrect, or that the Jar has external dependencies to other jars not listed properly in the Class-Path entry.

  • Getting a file name using java.io.file

    Dear List,
    I am having problems using java.io package. I am reading a string on a linux tomcat server. I am
    trying to parse a windows type filepath (passed by a web-browser-client) and get only the filename. ie. sample.jpg.
    fileName = "c:\\temp\\sample.jpg"
    java.io.File file = new File(fileName);
    onlyFileName = file.getName();
    remember this on linux, and on my server onlyFileName contains "c:\\temp\\sample.jpg" and not sample.jpg as I would expect.
    can any one tell me what I (yet again) dont understand.? Strangely enough when the server is on windows and I am passing a linux string with the fileseperator as a forward-slash, the code manages to derive the correct filename.
    regards
    Ben

    Post this to the beginners forum - has nothing to do
    with native methods.Apologies I thought Java.io would be "native".
    sorry,
    BB

  • Java.io.File not found in JDK 1.4

    why the java.io.file is deprecated.
    Frans

    [fthamura],
    why the java.io.file is deprecated.Probably because in J2SE 1.4, the New I/O package java.nio package provides scalable I/O operations for files. Through the File channels, a programmer will be able to provide memory-mapped buffers, improved file locking mechanism and faster I/O transfers with the new API package.
    FransHTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

Maybe you are looking for

  • Upgrade my iphone 4 to ios 7.02, can't sync , asking for authorize

    just upgrade my iphone 4 to ios 7.. and the problem is i can't sync my iphone to itunes now and the reason always "authorize the computer".. already done it several times (authorize > deauthorize > authorize) still can't sync. anyone can help me? thx

  • OSX Lion ram usage

    Well, i've got my 13' Macbook Air today (4gb ram), and love it. The only thing that bothers me is the extremely high ram usage of Lion, when i turn the Macbook on it jumps to about 1.3gb ram usage which i find really much considering my PC running Wi

  • Restart problem with my Nokia 110

    I got nokia 110 two months before. Suddenly after I tried to run a memory card it started restarting. I have tried to restore it but fone again restarts before the restoration has completed.I have successfully restored the device using  *#7780# but p

  • Why cant i embed video's on my website?

    Im creating a music website and when i try to embed videos to my site it wont let me do so.

  • Enabling web services in OIA throws error

    Hi, We have OIA 11gR1 installed in our environment and we are enabling web service in OIA. As per Oracle Docs, we have downloaded and installed wsdl4j-1.6.1.jar and placed in OIA_LIB. I have modified the web.xml to enable the config related to web se