How to find packages using class path

how to list all the packages in my class path using a java program?
for eg. if the class path is c:\ajay;
and ajay contains two folders pack1(i.e a package) and pack2(i.e a general folder not a package)
in pack1 there are 2 java file which has package pack1; as their first statement.
in pack2 there are two java file which does not contain package statement.
so can i identify between pack1 which is a package and pack2 which is a general folder

I don't think there's any real way to distinguish a package from an "ordinary directory" except by checking if for *.class files.
Probably you want to use a recursive method to walk the direcotories, calls itself tor each sub-directory found.

Similar Messages

  • How to find out web-inf path from the physical drive?

    How to find out web-inf path from the physical drive?
    I have some user profiles in web-inf directory.SO I want to know the path from root directory like
    d:/program files/allaire/jrun/appname/web-inf/profiles/username like that.
    Presently I am able to get the path upto the application directory and from that I am concatinationg web-inf/profiles/username .
    But it is giving problems when it is deployed under unix or linux.Because web-inf there it treats as WEB_INF
    SO I want to get the path of web-inf directory with out hard coding.
    Thanku

    String path = application.getRealPath("/WEB-INF/profiles/username");
    Note sure why you need this, but you don't need the real path to read the file - you can get an InputStream using the relative path. See ServletContext getResource() and getResourceAsStream().

  • How to find classtype and class for a material.

    Hi,
    How to find classtype and class for a material.
    which table contains this data.
    Thanks
    Kiran

    Hi Kiran,
    Check below sample code. Use this BAPI which will give all info about the class for the material.
      DATA:      l_objectkey_imp    TYPE bapi1003_key-object
                                         VALUE IS INITIAL.
      CONSTANTS: lc_objecttable_imp TYPE bapi1003_key-objecttable
                                         VALUE 'MARA',
                 lc_classtype_imp   TYPE bapi1003_key-classtype
                                         VALUE '001',
                 lc_freight_class   TYPE bapi1003_alloc_list-classnum
                                         VALUE 'FREIGHT_CLASS',
                 lc_e               TYPE bapiret2-type VALUE 'E',
                 lc_p(1)            TYPE c             VALUE 'P',
                 lc_m(1)            TYPE c             VALUE 'M'.
      SORT i_deliverydata BY vbeln posnr matnr.
      CLEAR wa_deliverydata.
      LOOP AT i_deliverydata INTO wa_deliverydata.
        REFRESH: i_alloclist[],
                 i_return[].
        CLEAR:   l_objectkey_imp.
        l_objectkey_imp = wa_deliverydata-matnr.
    *Get classes and characteristics
        CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
          EXPORTING
            objectkey_imp         = l_objectkey_imp
            objecttable_imp       = lc_objecttable_imp
            classtype_imp         = lc_classtype_imp
    *   READ_VALUATIONS       =
            keydate               = sy-datum
            language              = sy-langu
          TABLES
            alloclist             = i_alloclist
    *   ALLOCVALUESCHAR       =
    *   ALLOCVALUESCURR       =
    *   ALLOCVALUESNUM        =
            return                = i_return
    Thanks,
    Vinod.

  • How to find u0091Where used list of BSP Applicationu0092?

    Hi,
    In standard, one BSP application is calling another BSP application by hard coded in application.
    I want find a where used list of a BSP application.
    How to find ‘Where used list of BSP Application’?
    Regards,
    ...Naddy

    Hi Naddy,
    there is a way to find such hard coded things as long as they are really written as literal in the coding. So far i havn't used it on BSP but it's just a token search.
    You can use the code inspector for such things (TCode SCI). You define an object list. Therefore you have to use the static list (dynamic won't work) e.g. for all objects in a package. The ugly thing is that sap has built a filter in SCI that you cannot run it on their standard objects (no comment on that). So you get always 0 objects on sap packages. But you can debug into SCI and set a break point on statement 'SELECT'. One of the selects gets the objects from repository. In this statement sap hands select options to exclude SAP objects. If you change the values you can get these objects in the list.
    Then you run a search on these objects to find the string you look for.
    Ok that's not very comfortable but still faster than checking dozens of objects by hand.
    Best regards
    Roman

  • How to find the Feeder class behind Incident creation in SAP EHS?

    I have a requirement where i need to change the message text after clicking "Send" button while creating Incident.
    How to find the feeder class and method which is called behind "Send" button ?
    Thanks,
    Vimal

    I dont have such.. but you can set  external debug point in function module POWL_QUERY_REFRESH
    * get the result object type from the feeder
       lr_feeder->get_object_definition(
          EXPORTING
           i_selcrit_values = lt_crit_para  " selcrit dependent object def.
           i_langu = l_langu                                     "nt_1673495
           i_type  = i_query_data-type
          IMPORTING
           e_object_def = lr_object_def
    In I_QUERY_DATA-TYPE you can see name of POWL ID.
    Find it in transaction POWL_TYPE and you get name of feader class!

  • How to find and use MS Office on new MBA

    How to find and use MS Office on new MBAir

    Office is not preinstalled on Mac computers. Since the MacBook Air lacks an optical drive, the most convenient way to get Office is to purchase it as a download from Microsoft here.

  • Find package using program name/FM name.

    Hi,
    I want to find package using program name/FM name.
    Thanks,
    Amol

    open se38
    give program name and GOTO -> Attributes
    or  for forms
    open se71 and give formname and goto-> attributes
    u can findout package name.
    Regards,
    Ajay

  • How to Find Packages/Procedures using any particular table

    Hi,
    I want to find out the procedures,packages using any particular table. Please tell me how to find out.

    >
    I want to find out the procedures,packages using any particular table. Please tell me how to find out.
    >
    You can use the utldtree.sql in the rdbms\admin folder to do that. See my reply in this thread
    Re: Finding out all procedures , functions in a tree like structure in sequence
    The comments in the script (and in the thread) show how to use it. The script creates a table, a view and a procedure.
    Then you just use it like the comments describe. Here is the result for my SCOTT.EMP table. You can see I have a lot of packages and functions and things that depend on that table.
    execute deptree_fill('table', 'scott', 'emp');
    select * from ideptree
    OBJECT_NAME,SCHEMA,NAME,TYPE,STATUS
    0. EMP,SCOTT,EMP,TABLE,VALID
          1. PAK_TEST1,SCOTT,PAK_TEST1,PACKAGE,INVALID
                2. PAK_TEST1,SCOTT,PAK_TEST1,PACKAGE BODY,VALID
          1. GET_EMP,SCOTT,GET_EMP,FUNCTION,INVALID
          1. THREE_TABLE_EMP_VIEW,SCOTT,THREE_TABLE_EMP_VIEW,VIEW,INVALID
          1. TEST_PKG,SCOTT,TEST_PKG,PACKAGE,INVALID
                2. TEST_PKG,SCOTT,TEST_PKG,PACKAGE BODY,VALID
          1. TEST_F,SCOTT,TEST_F,FUNCTION,INVALID
          1. PIPELINE,SCOTT,PIPELINE,FUNCTION,INVALID
          1. GETOLDSAL,SCOTT,GETOLDSAL,FUNCTION,INVALID
          1. UPDATESAL_RETURNOLDSAL,SCOTT,UPDATESAL_RETURNOLDSAL,FUNCTION,INVALID
          1. EMP_HIER_PKG,SCOTT,EMP_HIER_PKG,PACKAGE,INVALID
                2. EMP_HIER_PKG,SCOTT,EMP_HIER_PKG,PACKAGE BODY,INVALID
          1. EMP_TBL,SCOTT,EMP_TBL,TYPE,INVALID
          1. EMP_HIER_PKG,SCOTT,EMP_HIER_PKG,PACKAGE BODY,INVALID
          1. TEST_REFCURSOR_PKG,SCOTT,TEST_REFCURSOR_PKG,PACKAGE BODY,VALID
          1. DOIT,SCOTT,DOIT,PROCEDURE,VALID
          1. DOIT1,SCOTT,DOIT1,PROCEDURE,VALID
          1. LSZRPT,SCOTT,LSZRPT,PACKAGE,INVALID
                2. LSZRPT,SCOTT,LSZRPT,PACKAGE BODY,INVALID
          1. F_GET_NAME,SCOTT,F_GET_NAME,FUNCTION,INVALID
          1. TEST_REFCURSOR_PKG1,SCOTT,TEST_REFCURSOR_PKG1,PACKAGE BODY,INVALID
          1. TEST2,SCOTT,TEST2,PROCEDURE,INVALID
          1. TAX_COST_SP,SCOTT,TAX_COST_SP,PROCEDURE,INVALID
          1. V_EMP,SCOTT,V_EMP,VIEW,VALID
                2. EMPLOYEES,USER1,EMPLOYEES,SYNONYM,VALID
          1. VIEW_EMP_TEST,SCOTT,VIEW_EMP_TEST,VIEW,VALID
          1. MASTER_MV,SCOTT,MASTER_MV,MATERIALIZED VIEW,INVALID
          1. TEST_VIEW,HR,TEST_VIEW,VIEW,VALID
          1. MYEMPVIEW,SCOTT,MYEMPVIEW,VIEW,VALID
          1. MYEMPVIEW1,SCOTT,MYEMPVIEW1,VIEW,VALID
          1. TEST_NDX,SCOTT,TEST_NDX,VIEW,VALID
          1. PKG1,SCOTT,PKG1,PACKAGE,VALID
          1. EMP_ACTIONS,SCOTT,EMP_ACTIONS,PACKAGE BODY,INVALID
          1. MYPACKAGE,SCOTT,MYPACKAGE,PACKAGE,VALID
          1. V_EMP1,SCOTT,V_EMP1,VIEW,VALID
          1. IDEXISTS,SCOTT,IDEXISTS,PROCEDURE,VALID
          1. VIEW_TEST_EMP,SCOTT,VIEW_TEST_EMP,VIEW,INVALID
          1. GET_EMP_REC,SCOTT,GET_EMP_REC,FUNCTION,VALID
          1. GET_EMP_CLOB,SCOTT,GET_EMP_CLOB,FUNCTION,VALID

  • How to use class path library

    We are using java in built library to write the xml filw which "XSLT". One library named "saxon9he.jar" is already on my system at the path "C:\Program Files\Java\jre1.5.0_15\lib\ext" . when I run the progaram to read/ write in xml file, my progarm use this system library saxon9he.jar.
    And generate the exception "Exception Caught while Checking tag in XMLjava.net.URISyntaxException: Illegal character in path at index 2: ./\config\SDBExplorer.xml stacktrace net.sf.saxon.trans.XPathException: java.net.URISyntaxException: Illegal character in path at index 2: ./\config\SDBExplorer.xml"
    What I should do so that in class path it will take XSLT for xml operation instead of saxon9he.jar
    Thanks!
    Aayushi SOni

    aanu wrote:
    ..One library named "saxon9he.jar" is already on my system at the path "C:\Program Files\Java\jre1.5.0_15\lib\ext" . when I run the progaram to read/ write in xml file, my progarm use this system library saxon9he.jar.
    ..What I should do so that in class path it will take XSLT for xml operation instead of saxon9he.jarGee. Isn't this a poster child for the Sun advice to not put APIs into the ${java.home}/lib/ext/?
    The answer is to
    - Remove the saxon9he.jar from the ${java.home}/lib/ext
    - Add APIs to whatever application requires them, at run-time.
    Thanks!No wuckin' forries.

  • How to use Class-Path in Manifest file

    hi,
    I want to add jar files in another executable jar file but the Class-Path in Manifest file is not set correctly,please give an example for setting a Class-Path attribute in Manifest class.
    regards,
    selvaraj

    You looked into the Jar section of the Sun tutorial did you?

  • How to find out which class/method is calling System.gc

    Hi
    I am seeing frequent FULL GC and not able to locate which particular class/method is calling the System.gc(). I have disabled it using -XX:DisableExplicitGC and performance issues have been resolved. Also, I noticed that it does not happen periodically, so it is not RMI GC. How to find out who exactly is doing this? Does any of of the profilers like Optimizeit/Jprobe help find out this.
    Thanks

    Hi
    I am seeing frequent FULL GC This is because you are creating and destroying objects VERY frequently. Try to look at your design and see where you can reuse objects (i.e. object pooling) if possible, that is if this is adversely affecting performance.
    and not able to locate
    which particular class/method is calling the
    System.gc(). Classes don't call GC. The VM handles that automagically.
    I have disabled it using
    -XX:DisableExplicitGC and performance issues have
    been resolved. Also, I noticed that it does not
    happen periodically, so it is not RMI GC. How to find
    out who exactly is doing this? Does any of of the
    profilers like Optimizeit/Jprobe help find out this.OptimizeIt will tell you everything you need to know. However, NetBeans offers a free profiler now!

  • Package and class path

    for two yrs i am trying to get package right but no result
    i am using window 98
    i have my jdk in d:\jdk1.2\bin; and this works fine if i do not try to use package;somtimes it works well half way with package!
    suppose i want to create a package called rubberband and put classes in it
    i created a folder called rubberband in d:\ and then
    package rubberband;
    import java.awt.*;
    public class RubberbandTest extends Frame{}
    class RubberbandTestPanel {}
    class Colorchoice{}
    this is one unit
    and there are other classes
    package rubberband;
    import java.awt.*;
    abstract class Rubberband {}
    package rubberband;
    import java.awt.*;
    class RubberbandPanel extends Rubberband {}
    and so on
    i opened executive.bat and added to class path as follows:
    path:d:\rubberband\bin;before the already existing d:\jdk1.2\bin;
    then when i come to compile and run the program i have problems
    like:class so and so not found
    please help please step by step tell me what to do

    Another sample might answer your "different location" question.
    Suppose program YourProg in package yourPkg located in directory C:\javaprogs needs to access a class file ExtraClass in package extraPkg in directory C:\differentDir.
    1) Of course the source file must exist in file
    C:\javaprogs\yourPkg\YourProg.java
    and
    C:\differentDir\extraPkg\ExtraClass.class must exist.
    2) Inside the YourProg source, you must import ExtraClass:
    import extraPkg.ExtraClass;
    3) To compile YourProg, you must include location of extraPkg.ExtraClass in the classpath (or the compiler will complain about the inport line above):
    (a -- from C:\javaprogs directory): javac -classpath C:\differentDir yourPkg\YourProg.java
    (b -- from any directory): javac -classpath C:\javaprogs;C:\differentDir yourPkg\YourProg.java
    4) To run YourProg (assuming it contains a main method), you must include all locations in classpath:
    (a -- from C:\javaprogs directory): java -classpath .;C:\differentDir yourPkg.YourProg
    (b -- from any directory): java -classpath C:\javaprogs;C:\differentDir yourPkg.YourProg
    If you get a NoClassDefFoundError, that means that the java was run without the proper location included in the classpath passed to the -classpath argument. The -classpath argument should be ';'-separated and contain no spaces (so if a long directory name contains space you should enclose in double quotes, as this example:
    java -cp "C:\Program Files\somedir;C:\anotherdir" NameOfAClass

  • How to find out import & export path for object migration between D Q & P?

    Hi guys!
    Is there a way, how to find out export and import path for object transport on XI?
    Thanx!
    Olian

    Hi,
    Have a look at these links.
    When we do an export of the IR or the ID Oblects, a typical path at which it gets exported in the XI Server is as follow:
    For IR Objects:
    “C:\usr\sap\PI1\SYS\global\xi\repository_server\export “
    For ID Objects:
    "C:\usr\sap\PI1\SYS\global\xi\directory_server\export"
    Now in case you need to import the ".tpz" that you have.... You need to place it in the path mentioned below and u will be able to do import it from IR or ID...
    For IR Objects:
    “C:\usr\sap\PI1\SYS\global\xi\repository_server\import “
    For ID Objects:
    "C:\usr\sap\PI1\SYS\global\xi\directory_server\import"
    File Level transport in sap xi
    Every SLD related transport details are explained here
    Regarding transport of SLD objects
    https://service.sap.com/~sapdownload/011000358700001684302005E/HowToSLDandXI.pdf
    Regarding transport of XI objects
    http://help.sap.com/saphelp_nw04/helpdata/en/93/a3a74046033913e10000000a155106/content.htm
    Regards,
    Akshay Jamgaonkar.
    Reward points if find useful.
    Message was edited by:
            Akshay Jamgaonkar
    Message was edited by:
            Akshay Jamgaonkar

  • (AS 3.0) How to separate functionality using classes

    Anyone familiar with this? I have already tried dividing
    among classes and it is not working.
    I have created the following code that pulls data from an
    external xml file into a datagrid. I have been trying to figure out
    how to get it to function using classes and/or packages. I'd like
    to separate the functionality into separate classes for each of the
    following:
    1) A class for loading the XML file(s) (there will likely be
    more datagrids and more xml files)
    2) A class for "drawing" the datagrid based on the xml
    .... others you can think of??
    I have attached the code in question.
    Thanks,
    Mark

    zoran,
    Sorry,I didn't explain what to do very clearly :).
    Básically, the event.taget parameter is set when you use the
    dispatchEvent function, so if you want an event to be dispatched
    from a Object you must call the dispatchEvent from this function.
    The line I gave you wont work by itself since I don't know
    how you reference
    DataEntry0._UpdateDeleteProd1.Form10.FormItem102.HBox103.Button104
    in your application.
    But what you need to do is call the dispatchEvent function in
    the Button104 object with the specific event you want to trigger.

  • How to find package dimension buffered

    Hi Guru!
    on the last EWA, SAP found some package dimension buffered.
    "ATTENTION:
    There are buffered package dimensions.
    Unbuffer these dimensions immediately.
    Naming convention: /<NAME-RANGE>/D<INFOCUBE>P
    Note 857998 - Number range buffering for DIM IDs and SIDs explain that NO PackageDimension should be buffered.
    So, could you explain how to find those package??
    And then, to unbuffered, I can do this through SNRO?
    Tks a lot
    ciao

    Hi Cristian:
       I suppose you've been trying to optimize your data loads by means of Number Range buffering as described in the following blog:
    /people/vikash.agrawal/blog/2006/04/05/load-lots-of-data-147faster148-with-buffering-number-range
    The thing is that in the process you have buffered Package dimensions for a(n) InfoCube(s) and that is not recommendend by SAP, remember that those are special Dimensions along with the Time and Unit dimensions used in every InfoCube.
    To unbuffer the Package Dimension do the following:
    Execute Transacion Code SNRO
    Enter object for package dimension
    Change
    Edit
    Setup buffering
    No buffering.
    Regards,
    Francisco Milán.

Maybe you are looking for