Passing a binary file to class outputing a compressed file

Hi,
Am i writing a program which gets passed a file to encode via "java compressor < <filename>".
Compressor is a class with main method.
what i have right now is simply:
public class Compressor {
     * @param args the command line arguments
    public static void main(String[] args) {
        InputStream in = new FileInputStream ("");
        File f = new File ("");
        ByteArrayOutputStream out = new ByteArrayOutputStream (f.length());
        int i;
        while ((i = in.read()) != -1) {
            out.write(i);
        in.close();
        byte[] result = out.toByteArray();
        for (int j = 0 ; i < result.length ; j++) {
            byte a = result[j];
} The program is suppose to read the input one byte at a time and treats each one as an instruction which encodes byte compressoring the file and finally outputing this newly compressed file. I'm not sure how the main method will take the filename i.e "java compressor examplefile", any guidance would help greatly.
Thanks

in the case above, the command line arguments are passed in the aaaaaaaaaaaaaaaaaaaaaaarggggggggggs array
you probably want aaaaaaaaaaaaaaaaaaaaaaarggggggggggs[0] for the filenameAm not sure i understand, do you mean i must change the param of the main method to String[] args[0] as this resulted in error when i did so. Or do you mean at command line instead file simply being passed to the Compressor program as
"java Compressor < examplefilename"
It has to be "java Compressor < examplefilename[0]" ?
If you could expand on this, would be grateful,
Thanks.

Similar Messages

  • GUI to set file, other class to read it, file null error

    Perhaps not the most informative subject for this problem. I have a GUI in which a file chooser is used to select a file to be read. Another class reads in this file, and goes on to process it. My main class sets up the GUI and then goes on to process the files in the second class.
    I am having trouble, I believe, with timing. The main class sets up the GUI, it runs perfectly, and then I catch a problem (that will evolve into an error), where the file I am supposed to process is null, because I have not had a chance to use the file chooser in the GUI. I haven't had any luck finding a solution online, although if there is one (or another tutorial I missed), please feel free to pass the link(s) along. I am posting the relevant code below.
    Thanks,
    Danielle
    public Main()
         * @param args the command line arguments
        public static void main(String[] args)
             javax.swing.SwingUtilities.invokeLater(new Runnable()
                   public void run()
                        System.out.println("About to run create GUI method");
                        MGui app = new MGui();
                        System.out.println("declared a new MGui....");
                        app.createAndShowGUI();
            /**Starting to get file choices and moving them into GPR Handler:
              GprHandler gpr = new GprHandler();
         //~ System.out.println("should be perfect????");
         //  }//end if
        }// end main(String[] args)
    }// end class MainThe GUI uses the following code for the file chooser:
    private class enterFile2Action implements ActionListener
         public void actionPerformed(ActionEvent evt)
              JFileChooser chooser = new JFileChooser();
              int rVal = chooser.showOpenDialog(enterFile1);
              if(rVal == JFileChooser.APPROVE_OPTION)
                   inputFile2 = chooser.getSelectedFile();
                   PrintWriter outputStream;
                   file2Name = inputFile2.getName();
                   enterLabel2.setText(file2Name);
    }Finally, the GprHandler class processes the file- reading it and such. The only relevant method, however is below.
       /** taking in files*/
        public boolean readFiles()
             boolean nullFiles = true;
             System.out.println("into method readFiles()");
         if (MGui.get1Name() != null)
              System.out.println("name isn't null");
              file1Name = MGui.get1Name();
              file1 = new File(file1Name);
         if (MGui.get2Name() != null)
              file2Name = MGui.get2Name();
              file2 = new File(file2Name);
              nullFiles = false;
         }//end if
         if (nullFiles)
              System.out.println("one or more files is undeclared");
              return false;
         }//end if
         else
            try{
             file1Reader = new FileReader(file1);
                file2Reader = new FileReader(file2);
         }//end try
            catch (FileNotFoundException e)
             System.out.println("file not found exception");
              return false;
            }     //end catch
         }//end else
         return true;
        }

    No, you're quite right. I want the GprHandler to
    start when I've got something there for it to start
    with. I never thought to call it from the
    actionPerformed though. I think I've been listening
    to too many lectures on some prof's definition of a
    "proper main class".
    I think I understand what you're suggesting: I
    should simply remove the GprHandler part from my main
    class and place it instead in the actionPerformed
    methods, once the files are actually named/chosen.
    Did I get that right?
    Qualified yes. Does GPRHandler implement Runnable? I mean you don't want to do the processing in the swing event thread. So what you should do is in the actionPerformed create the Handler (with the file or whatever other bits it needs) and then start it.
    Then it can process merrily along in a seperate thread.

  • How to include text file in classes directory of war file.

    I have a project that uses a text file called cache.ccf (JCS configuration file) when debugging the webservices, I have to dig into the inflated war file directory and manually place the cache.ccf file in the WEB-INF/classes/ directory/
    How can i have JDeveloper wrap the file up in the war file in the WEB-INF/classes directory. both for debugging and when the war file is actually built for deployment.
    Thanks,
    Bart

    Nevermind, I figured it out using the Project Properties->Deployment and include it in the WEB-INF/classes

  • File Share Search problem with Compress file

    I have a content source in SharePoint 2013 search which crawl files from a file share. Some of the files have "Compress contents to save disk" attribute set to true. 
    These files are being crawled as I can see them in Crawl logs. But when I search for these documents in search center, it only return the documents which don't have compression attribute set.  I have even tried searching document title. Any idea?

    Hi Rashid,
    What keyword did you use for searching the compressed file?
    As your description, I set a file as the below:
    Then I created a File Share content source pointed to the folder which contains the file, then start a full crawl.
    After crawling, I went to my search center, and searched, the result was:
    When you search the compressed file, check whether the item title returns a part of the content of the document.
    Best Regards,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Class holding other compressed files inside.

    Hi folks,
    May anybody tell me how Forte for Java installer holds all its installation files inside a single .class file?
    Example, I call
    /usr/local$ java f4jsetup.class
    And it extracts all installation files from this very class.
    Thank you all, in advance,
    Filipe Fedalto

    I can actually devise some idea about it, but I am sure Sun has a better implementation.
    Well, I can create a class that will read itself as a File, compute its class file size and store some raw data beyond the final position. Perhaps the first bytes could be some token like write("===raw data starts here===");
    Then it will write all raw data. When executed again, it will see some data already stored beyond its class code ending position and will start reading this data stored at the end of file.
    Ok, this is a very crappy implementation and I would really be very impressed if it actually worked. May be I will give a try and post it back... so keep watching this topic if you are interested in this implementation.
    Still, I think that there is some better way to do it.
    Thank you anyways :-)
    Filipe Fedalto

  • How do I convert Wallet.class to a CAP file?

    I was trying to convert one of the sample files( Wallet.class) to a CAP file but it didn't work.
    Please help!!!

    Please be more specific. Describe what you did in detail, provide outputs of your actions etc. Otherwise noone can help you.
    Somebody save the world..

  • Multiples files for classes

    Hi
    what is the most using method in java developpement ?
    create 1 file for main and x files for class
    or
    create 1 file for main, and put all sub programs in the same things.
    Thanks for you answer.
    bob

    your question makes no sense.
    1 class per file, and as many classes as needed, just as the compiler tells you to.

  • Compress files in FTP

    Dear All,
    I want to download files around 2GB from FTP. It would be better to compress those files as a zipped/compressed file.
    How can i compress files in FTP via command line.
    Please help me...
    Thanks,
    Moorthy.GS

    Hey Tom,
    Presently i compressed the files using some ftp tool and download it.
    But i wrote a shell script for download the files from ftp and it schedule through cron jobs.
    Cheers,
    Moorthy.GS

  • Array out of bounds exception when outputting array to file

    Could someone please tell me why i'm getting this array out of bounds exception?
    public class Assignment1 {
    public static void main(String[] names)throws IOException {
    BufferedReader keyboard = null;
    String userChoice;
    String inputFile = null;
    String studentData;
    String searchFile = null;
    String searchName;
    String stringIn;
    PrintWriter outputFile;
    FileWriter fWriter = null;
    BufferedReader fReader = null;
    int first;
    int last;
    int mid;
    int midValue;
    int i;
    int number;
    // creates keyboard as a buffered input stream
    keyboard = new BufferedReader(new InputStreamReader(System.in));
    //prompts user to choose 1 or 2 to make a corresponding choice
    System.out.println("Please Enter: ");
    System.out.println("1 to Create a File: ");
    System.out.println("2 to Search a File: ");
    userChoice = keyboard.readLine(); //user enters 1 or 2
    // converts a String into an int value
    number = Integer.parseInt(userChoice);
    fReader = new BufferedReader(new FileReader("studentData.txt"));
    if (number == 1) {          
    System.out.println("Please Enter the File Name to Create: ");
    studentData = keyboard.readLine();
    File file = new File("studentData.txt");
    fWriter = new FileWriter("studentData.txt");
    outputFile = new PrintWriter(fWriter);
    names = new String[200];
    i=0;
    //keep looping till sentinel
    while (studentData != "end" && studentData != null &&
    i < names.length) {
    if (studentData.equals("end")) break; //break and call sort
    System.out.println("Enter a name and press Enter. " +
    "Type 'end' and press Enter when done: ");
    studentData = keyboard.readLine();
    //loop for putting the names into the array
    for(i=0; i<names.length; i++) ;
    outputFile.println(names);
    } [b]outputFile.close();

    package assignment1;
    import java.io.*;
    import java.util.*;
    public class Assignment1 {
        public static void main(String[] names)throws IOException {
           BufferedReader keyboard = null;
           String userChoice;
           String inputFile = null;
           String studentData;
           String searchFile = null;
           String searchName;
           String stringIn;
           PrintWriter outputFile;
           FileWriter fWriter = null;
           BufferedReader fReader = null;
           int first;
           int last;
           int mid;
           int midValue;
           int i;
           int number;
           // creates keyboard as a buffered input stream
           keyboard = new BufferedReader(new InputStreamReader(System.in));
           //prompts user to choose 1 or 2 to make a corresponding choice
           System.out.println("Please Enter: ");
           System.out.println("1 to Create a File: ");
           System.out.println("2 to Search a File: ");
           userChoice = keyboard.readLine();    //user enters 1 or 2
           // converts a String into an int value
           number = Integer.parseInt(userChoice); 
           fReader = new BufferedReader(new FileReader("studentData.txt"));
           if (number == 1) {          
               System.out.println("Please Enter the File Name to Create: ");
               studentData = keyboard.readLine();
               File file = new File("studentData.txt");
               fWriter = new FileWriter("studentData.txt");
               outputFile = new PrintWriter(fWriter);
               names = new String[200];
               i=0;
                //keep looping till sentinel
                while (studentData.equals("end") && studentData != null &&
                       i < names.length) {
                   if (studentData.equals("end")) break;   //break and call sort
                   System.out.println("Enter a name and press Enter. " +
                                       "Type 'end' and press Enter when done: ");
                    studentData = keyboard.readLine();
                    //loop for putting the names into the array
                    for(i=0; i<names.length; i++) ;
                    outputFile.println(names);
    } outputFile.close();
    //call selectionSort() to order the array
         selectionSort(names);
         // Now output to a file.
    fWriter = new FileWriter("studentData.txt");
    outputFile = new PrintWriter(fWriter);
    } else if (number == 2) {
    System.out.println("Please Enter a File Name to search: ");
    searchFile = keyboard.readLine();
    inputFile = ("studentData.txt");
    } if (searchFile == "studentData.txt") {                      
    // Input from a file. See input file streams.
    fReader = new BufferedReader(new FileReader("studentData.txt"));
    System.out.println("Please enter a Name to search for: ");
    searchName = keyboard.readLine();
    //enter binary search code
    first = 0;
    last = 199;
    while (first < last)
    mid = (first + last)/2; // Compute mid point.
    if (searchName.compareTo(names[mid]) < 0) {
    last = mid; // repeat search in bottom half.
    } else if (searchName.compareTo(names[mid]) > 0) {
    first = mid + 1; // Repeat search in top half.
    } else {
    // Found it.
    System.out.println("The Name IS in the file.");
    } // did not find it.
    System.out.println("The Name IS NOT in the file.");
    } else //if userChoice != 1 or 2, re-prompt then start over
    System.out.println("Please Enter 1 or 2 or correctly " +
    "enter an existing file!!");
    // fWriter = new FileWriter("studentdata.txt");
    //outputFile = new PrintWriter(fWriter); //output
    public static void selectionSort(String[] names) {
    //use compareTo!!!!
    int smallIndex;
    int pass, j = 1, n = names.length;
    String temp;
    for (pass = 0; pass < n-1; pass++)
    //Code for Do/While Loop
    do {
    //scan the sublist starting at index pass
    smallIndex = pass;
    //jtraverses sublist names[pass+1] to names[n-1]
    for (j = pass+1; j < n; j++)
    //if smaller string found, smallIndex=that position
    if (names[j].compareTo(names[smallIndex]) < 0)
    smallIndex = j;
    temp = names[pass]; //swap
    names[pass] =names[smallIndex];
    names[smallIndex] = temp;
    } while (j <= names.length);
    //File file = new File("studentData.txt");
    This is the output window:
    init:
    deps-jar:
    compile:
    run:
    Please Enter:
    1 to Create a File:
    2 to Search a File:
    1
    Please Enter the File Name to Create:
    test
    Exception in thread "main" java.lang.NullPointerException
    at assignment1.Assignment1.selectionSort(Assignment1.java:134)
    at assignment1.Assignment1.main(Assignment1.java:73)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 9 seconds)

  • Anyone know how to output an XML file from ABAP to a non sapgui location?

    I have a program that creates XML and then outputs a file via CALL METHOD cl_gui_frontend_services=>gui_download. But now I want to execute the program in background mode and therefore I need to be able to output that XML to a NON sapgui file location. Current code creates the XML to an internal table which is binary then the gui_download method converts that to output XML. .  Does anyone know how I can change the code to either a) output the XML to an internal table which can be output via, say, a TRANSFER command..or, b) output the created binary table of XML to a NON sapgui file location?
    Excerpts from current code are as follows:
    first the XML is created (to the binary file)
          Creating a ixml factory
      l_ixml = cl_ixml=>create( ).
          Creating the dom object model
      l_document = l_ixml->create_document( ).
          Fill root node with value XML
      l_element_xml  = l_document->create_simple_element(
                  name = 'XML'
                  parent = l_document ).
          Create tag 'HEADER' as child of 'XML'
      l_element_header  = l_document->create_simple_element(
                  name = 'HEADER'
                  parent = l_element_xml  ).
    header information about the file and general data about the fleet follows
      l_value = c_fleet_import.
      l_element_dummy  = l_document->create_simple_element(
                name = 'TYPE'
                value = l_value
                parent = l_element_header ).
    etc.......
    then the xml is connected to the stream factory and rendered
      Creating a stream factory
      l_streamfactory = l_ixml->create_stream_factory( ).
      Connect internal XML table to stream factory
      l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ).
      Rendering the document
      l_renderer = l_ixml->create_renderer( ostream  = l_ostream
                                            document = l_document ).
      l_rc = l_renderer->render( ).
      Saving the XML document
      l_xml_size = l_ostream->get_num_written_raw( ).
    and then output to the file
      IF sy-subrc = 0.
        CALL METHOD cl_gui_frontend_services=>gui_download
           EXPORTING
             bin_filesize = l_xml_size
            filename     = 'g:\sapdms\BSCC-DEV\EFPAC XML Files\ALL.xml'
           filename     = '/TRICK/727/OUT/ZEFP/EFPAC.XML' "doesnt work with sap gui
             filetype     = 'BIN'
           CHANGING
             data_tab     = l_xml_table
           EXCEPTIONS
             OTHERS       = 24.
    as implied by the comments the method above will successfully output the XML file to the g:drive but will not output to /TRICK/ location, which is where I need it to go in a background mode run.
    This is a problem which has defeated all our local expertise and I would appreciate any help given... Barry Jones

    Try this code below:
    data  l_xml_table2  type table of xml_line with header line.
    W_filename - This is a Path.
      if w_filename(02) = '
        open dataset w_filename for output in binary mode.
        if sy-subrc = 0.
          l_xml_table2[] = l_xml_table[].
          loop at l_xml_table2.
            transfer l_xml_table2 to w_filename.
          endloop.
        endif.
        close dataset w_filename.
      else.
        call method cl_gui_frontend_services=>gui_download
          exporting
            bin_filesize = l_xml_size
            filename     = w_filename
            filetype     = 'BIN'
          changing
            data_tab     = l_xml_table
          exceptions
            others       = 24.
        if sy-subrc <> 0.
          message id sy-msgid type sy-msgty number sy-msgno
                     with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        endif.

  • Adobe Forms function module - downloading the xstring output in PDF file

    Hi Guys,
    I'm using Adobe forms and fetching its output in an XSTRING PDF format. How can I download this XSTRING output to a PDF file and store on the local file system?
    I'm using the following approach to getting a PDF output:
    ls_outputparams-getpdf = 'X'.
    CALL FUNCTION 'FP_JOB_OPEN'
      CHANGING
        ie_outputparams = ls_outputparams.
    * Get the name of the generated function module
      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
        EXPORTING
          i_name     = 'ZADOBEFORM'
        IMPORTING
          e_funcname = lv_fmname.
      IF sy-subrc <> 0.
      ELSE.
    *   Call the Adobe Form function module
        CALL FUNCTION lv_fmname
          EXPORTING
            /1bcdwb/docparams  = ls_docparams
          IMPORTING
            /1bcdwb/formoutput = ls_form_output
          EXCEPTIONS
            usage_error        = 1
            system_error       = 2
            internal_error     = 3.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    * Close the spool job
    CALL FUNCTION 'FP_JOB_CLOSE'.
    Now, the variable LS_FORM_OUTPUT-PDF contains the PDF output in XSTRING. My question is how can I download this as a PDF file to my local machine.
    Kind Regards,
    Shailesh.

    hi guys,
    im using all FM to download my PDF adobe but in this part :
    ls_spfli-carrid = 'AA'.
    ls_spfli-connid = '0017'.
    APPEND ls_spfli TO it_spfli.
    flag                     = 'X'.
    is_address_type          = '1'.
    is_address_number        = '22515'.
    is_person_number         = '22517'.
    is_country               = 'IN'.
    *&--- Call the generated function module
    CALL FUNCTION '/1BCDWB/SM00000200'
       EXPORTING
    *   /1BCDWB/DOCPARAMS        =
         it_spfli                 = it_spfli
         flag                     = flag
         is_address_type          = is_address_type
         is_address_number        = is_address_number
         is_person_number         = is_person_number
         is_country               = is_country
      IMPORTING
        /1bcdwb/formoutput       = fp_formoutput
      EXCEPTIONS
        usage_error              = 1
        system_error             = 2
        internal_error           = 3
        OTHERS                   = 4
    I have usage_error knowing that the execution of the function module in SE37 pass successfuly and also the execution of the forms .
    in your opinion what can be the problem?
    Kind Regards,

  • Passing a parameter from one class to another class in the same package

    Hi.
    I am trying to pass a parameter from one class to another class with in a package.And i am Getting the variable as null every time.In the code there is two classes.
    i. BugWatcherAction.java
    ii.BugWatcherRefreshAction.Java.
    We have implemented caching in the front-end level.But according to the business logic we need to clear the cache and again have to access the database after some actions are happened.There are another class file called BugwatcherPortletContent.java.
    So, we are dealing with three java files.The database interaction is taken care by the portletContent.java file.Below I am giving the code for the perticular function in the bugwatcherPortletContent.java:
    ==============================================================
    public Object loadContent() throws Exception {
    Hashtable htStore = new Hashtable();
    JetspeedRunData rundata = this.getInputData();
    String pId = this.getPorletId();
    PortalLogger.logDebug(" in the portlet content: "+pId);
    pId1=pId;//done by sraha
    htStore.put("PortletId", pId);
    htStore.put("BW_HOME_URL",CommonUtil.getMessage("BW.Home.Url"));
    htStore.put("BW_BUGVIEW_URL",CommonUtil.getMessage("BW.BugView.Url"));
    HttpServletRequest request = rundata.getRequest();
    PortalLogger.logDebug(
    "BugWatcherPortletContent:: build normal context");
    HttpSession session = null;
    int bugProfileId = 0;
    Hashtable bugProfiles = null;
    Hashtable bugData = null;
    boolean fetchProfiles = false;
    try {
    session = request.getSession(true);
    // Attempting to get the profiles from the session.
    //If the profiles are not present in the session, then they would have to be
    // obtained from the database.
    bugProfiles = (Hashtable) session.getAttribute("Profiles");
    //Getting the selected bug profile id.
    String bugProfileIdObj = request.getParameter("bugProfile" + pId);
    // Getting the logged in user
    String userId = request.getRemoteUser();
    if (bugProfiles == null) {
    fetchProfiles = true;
    if (bugProfileIdObj == null) {
    // setting the bugprofile id as -1 indicates "all profiles" is selected
    bugProfileIdObj =(String) session.getAttribute("bugProfileId" + pId);
    if (bugProfileIdObj == null) {
    bugProfileId = -1;
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    else {
    bugProfileId = Integer.parseInt(bugProfileIdObj);
    session.setAttribute(
    ("bugProfileId" + pId),
    Integer.toString(bugProfileId));
    //fetching the bug list
    bugData =BugWatcherAPI.getbugList(userId, bugProfileId, fetchProfiles);
    PortalLogger.logDebug("BugWatcherPortletContent:: got bug data");
    if (bugData != null) {
    Hashtable htProfiles = (Hashtable) bugData.get("Profiles");
    } else {
    htStore.put("NoProfiles", "Y");
    } catch (CodedPortalException e) {
    htStore.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    PortalLogger.logException
    ("BugWatcherPortletContent:: CodedPortalException!!",e);
    } catch (Exception e) {
    PortalLogger.logException(
    "BugWatcherPortletContent::Generic Exception!!",e);
    htStore.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.GET_BUGLIST_FAILED));
    if (fetchProfiles) {
    bugProfiles = (Hashtable) bugData.get("Profiles");
    session.setAttribute("Profiles", bugProfiles);
    // putting the stuff in the context
    htStore.put("Profiles", bugProfiles);
    htStore.put("SelectedProfile", new Integer(bugProfileId));
    htStore.put("bugs", (ArrayList) bugData.get("Bugs"));
    return htStore;
    =============================================================
    And I am trying to call this function as it can capable of fetching the data from the database by "getbugProfiles".
    In the new class bugWatcherRefreshAction.java I have coded a part of code which actually clears the caching.Below I am giving the required part of the code:
    =============================================================
    public void doPerform(RunData rundata, Context context,String str) throws Exception {
    JetspeedRunData data = (JetspeedRunData) rundata;
    HttpServletRequest request = null;
    //PortletConfig pc = portlet.getPortletConfig();
    //String userId = request.getRemoteUser();
    /*String userId = ((JetspeedUser)rundata.getUser()).getUserName();//sraha on 1/4/05
    String pId = request.getParameter("PortletId");
    PortalLogger.logDebug("just after pId " +pId);  */
    //Calling the variable holding the value of portlet id from BugWatcherAction.java
    //We are getting the portlet id here , through a variable from BugWatcherAction.java
    /*BugWatcherPortletContent bgAct = new BugWatcherPortletContent();
    String portletID = bgAct.pId1;
    PortalLogger.logDebug("got the portlet ID in bugwatcherRefreshAction:---sraha"+portletID);*/
    // updating the bug groups
    Hashtable result = new Hashtable();
    try {
    request = data.getRequest();
    String userId = ((JetspeedUser)data.getUser()).getUserName();//sraha on 1/4/05
    //String pId = (String)request.getParameter("portletId");
    //String pId = pc.getPorletId();
    PortalLogger.logDebug("just after pId " +pId);
    PortalLogger.logDebug("after getting the pId-----sraha");
    result =BugWatcherAPI.getbugList(profileId, userId);
    PortalLogger.logDebug("select the new bug groups:: select is done ");
    context.put("SelectedbugGroups", profileId);
    //start clearing the cache
    ContentCacheContext cacheContext = getCacheContext(rundata);
    PortalLogger.logDebug("listBugWatcher Caching - removing markup content - before removecontent");
    // remove the markup content from cache.
    PortletContentCache.removeContent(cacheContext);
    PortalLogger.logDebug("listBugWatcher Caching-removing markup content - after removecontent");
    //remove the backend content from cache
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(((JetspeedUser)data.getUser()).getUserName()));
    PortalLogger.logDebug("listBugWatcher Caching User: " +((JetspeedUser)data.getUser()).getUserName());
    PortalLogger.logDebug("listBugWatcher Caching pId: " +pId);
    if (pdata != null)
    // User's data found in cache!
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null");
    pdata.removeObject(PortletCacheHelper.getUserPortletHandle(((JetspeedUser)data.getUser()).getUserName(),pId));
    PortalLogger.logDebug("listBugWatcher Caching -inside pdata!=null- after removeObject");
    PortalLogger.logDebug("listBugWatcher Caching -finish calling the remove content code");
    //end clearing the cache
    // after clearing the caching calling the data from the database taking a fn from the portletContent.java
    PortalLogger.logDebug("after clearing cache---sraha");
    BugWatcherPortletContent bugwatchportcont = new BugWatcherPortletContent();
    Hashtable httable= new Hashtable();
    httable=(Hashtable)bugwatchportcont.loadContent();
    PortalLogger.logDebug("after making the type casting-----sraha");
    Set storeKeySet = httable.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, httable.get(paramName));
    PortalLogger.logDebug("after calling the databs data from hashtable---sraha");
    } catch (CodedPortalException e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put("Error", CommonUtil.getErrMessage(e.getMessage()));
    catch (Exception e) {
    PortalLogger.logException("bugwatcherRefreshAction:: Exception- ",e);
    context.put(     "Error",CommonUtil.getErrMessage(ErrorConstantsI.EXCEPTION_CODE));
    try {
    ((JetspeedRunData) data).setCustomized(null);
    if (((JetspeedRunData) data).getCustomized() == null)
    ActionLoader.getInstance().exec(data,"controls.EndCustomize");
    catch (Exception e)
    PortalLogger.logException("bugwatcherRefreshAction", e);
    ===============================================================
    In the bugwatcher Action there is another function called PostLoadContent.java
    here though i have found the portlet Id but unable to fetch that in the bugWatcherRefreshAction.java . I am also giving the code of that function under the bugWatcherAction.Java
    ================================================
    // Get the PortletData object from intermediate store.
    CacheablePortletData pdata =(CacheablePortletData) PortletCache.getCacheable(PortletCacheHelper.getUserHandle(
    //rundata.getRequest().getRemoteUser()));
    ((JetspeedUser)rundata.getUser()).getUserName()));
    pId1 = (String)portlet.getID();
    PortalLogger.logDebug("in the bugwatcher action:"+pId1);
    try {
    Hashtable htStore = null;
    // if PortletData is available in store, get current portlet's data from it.
    if (pdata != null) {
    htStore =(Hashtable) pdata.getObject(     PortletCacheHelper.getUserPortletHandle(
    ((JetspeedUser)rundata.getUser()).getUserName(),portlet.getID()));
    //Loop through the hashtable and put its elements in context
    Set storeKeySet = htStore.keySet();
    Iterator itr = storeKeySet.iterator();
    while (itr.hasNext()) {
    String paramName = (String) itr.next();
    context.put(paramName, htStore.get(paramName));
    bugwatcherRefreshAction bRefAc = new bugwatcherRefreshAction();
    bRefAc.doPerform(pdata,context,pId1);
    =============================================================
    So this is the total scenario for the fetching the data , after clearing the cache and display that in the portal.I am unable to do that.Presently it is still fetching the data from the cache and it is not going to the database.Even the portlet Id is returning as null.
    I am unable to implement that thing.
    If you have any insight about this thing, that would be great .As it is very urgent a promt response will highly appreciated.Please send me any pointers or any issues for this I am unable to do that.
    Please let me know as early as possible.
    Thanks and regards,
    Santanu Raha.

    Have you run it in a debugger? That will show you exactly what is happening and why.

  • Emdedding swf file as class throws error while previewing the component

    Dear all,
    I am using Flex SWFLoader to load an animated swf file and added it as a component in xcelsius by add on manager. When i click preview button it throws the folloing error.
    TypeError: Error #2023: Class must inherit from Sprite to link to the root.
    I am embedding swf file by using the following lines of code
    Embed('Animation_1.swf')
    public var Animation:Class;
    Then i tried to create my class by extending Sprite, i got the same error,
    Can you please anyone help me to solve this issue, all i need is the way to emded the swf file as class and using it in xcelsius. The embedded swf class is working fine alone (that is outside to the xcelsius).
    Thanks & Regards,
    Manimaran.
    Edited by: manimaraninfo on Jun 18, 2009 10:47 AM
    Edited by: manimaraninfo on Jun 18, 2009 10:48 AM

    Hi
    To embed a .swf file in xcelsius using SWFLoader, you have to pass the path of that swf file to the source property of SWFLoader.
    By using class concept xcelsius does not get the path of the swf file you have embeded.
    In flex It gets that file because that swf file is present in the same directory as your application.
    Hope this helps
    Regards
    Rush-me

  • Is text mining operations on document binary and its HTML output is simiar?

    Does the text mining operations differ when I perform on document binary or its HTML output? Do you think the results would be the same, if i performed clustering operation on the HTML or text output of a binary document instead of its binary file.
    Please comment!

    I assume you are trying to put an anchor tag in a text item, that points to a document stored elsewhere in the Portal repository.
    Use a direct access URL (search the online help for info on these) to construct the link to the document. You can use a relative URL by leaving out the "http://server.domain:port" part of the URL - e.g. {a href="/pls/portal30/docs/FOLDER/MYROOTFOLDER/MYSUBFOLDER/MyDocument.DOC"} - I'm using {} here instead of <> because real tags get messed up in these forum messages.
    The Portal FAQ explains how to use httpd.conf to define a redirect directive.
    Regards,
    Jerry
    null

  • How to capture output of java files using Runtime.exec

    Hi guys,
    I'm trying to capture output of java files using Runtime.exec but I don't know how. I keep receiving error message "java.lang.NoClassDefFoundError:" but I don't know how to :(
    import java.io.*;
    public class CmdExec {
      public CmdExec() {
      public static void main(String argv[]){
         try {
         String line;
         Runtime rt = Runtime.getRuntime();
         String[] cmd = new String[2];
         cmd[0] = "javac";
         cmd[1] = "I:\\My Documents\\My file\\CSM\\CSM00\\SmartQ\\src\\E.java";
         Process proc = rt.exec(cmd);
         cmd = new String[2];
         cmd[0] = "javac";
         cmd[1] = "I:\\My Documents\\My file\\CSM\\CSM00\\SmartQ\\src\\E";
         proc = rt.exec(cmd);
         //BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
         BufferedReader input = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
         while ((line = input.readLine()) != null) {
            System.out.println(line);
         input.close();
        catch (Exception err) {
         err.printStackTrace();
    public class E {
        public static void main(String[] args) {
            System.out.println("hello world!!!!");
    }Please help :)

    Javapedia: Classpath
    How Classes are Found
    Setting the class path (Windows)
    Setting the class path (Solaris/Linux)
    Understanding the Java ClassLoader
    java -cp .;<any other directories or jars> YourClassNameYou get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.
    javac -classpath .;<any additional jar files or directories> YourClassName.javaYou get a "cannot resolve symbol" message because the compiler can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

Maybe you are looking for