How to read a server side file in Applet?

When I used ZipFile like this,
ZipFile zf = new ZipFile("http://xxx.com/res.jar");
It throwed exception about access denied, File pemission...
How to read a server side file in Applet?

You generally can't tell with Stream how many bytes are going to be available. You could download the whole thing into a ByteBuffer, for example, and process it from there.
Or you can try opening an http connection explicitly (using URL and casting the connection to HttpURLConnection and see if there's a "Content-length" header.

Similar Messages

  • How to read list of all files in folder on application server?

    How to read list of all files in folder on application server?

    Hi,
    First get the files in application server using the following function module.
        CALL FUNCTION 'RZL_READ_DIR_LOCAL'
          EXPORTING
            name     = loc_fdir
          TABLES
            file_tbl = int_filedir.
    Here loc_fdir contains the application server path.
    int_filedir contains all the file names in that particular path.
    Now loop at int_filedir.
    OPEN DATASET int_filedir-name FOR INPUT IN TEXT MODE ENCODING  DEFAULT MESSAGE wf_mess.
    MESSAGE wf_mess.
        IF sy-subrc = 0.
          DO.
            READ DATASET pa_sfile INTO wf_string.
            IF sy-subrc <> 0.
              EXIT.
    endif.
    close datset int_filedir-name.
    endloop.

  • How to Open Or read SQL Server log file .ldf

    Hi all,
    How to Open Or read SQL Server log file .ldf
    When ever we create database from sql server, it's create two file. (1) .mdf (2) .ldf.
    I want to see what's available inside the .ldf file.
    Thanks,
    Ashok

    I am not too sure but may be the below two undocumented commands might yield the desired result.
    DBCC Log
    Fn_dblog function
    Refer these links for more info,
    http://www.mssqlcity.com/Articles/Undoc/SQL2000UndocDBCC.htm
    http://blogs.sqlserver.org.au/blogs/greg_linwood/archive/2004/11/27/37.aspx
    http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1173464,00.html
    Some 3rd party tools like Log Explorer can do the job for you.
    http://www.lumigent.com/products/le_sql.html
    - Deepak

  • Q abt. "Server Side File Tracking for Mobile Home Sync"

    I am following the steps "To optimize the file server for mobile accounts" which are listed on page 157 in Mac OS X Server v10.6 - User Management :
    In Server Admin, click the disclosure triangle for the server hosting network home folders for mobile accounts.
    If Firewall isn’t listed, select the server, click Settings, click Services, select Firewall, and then click Save.
    Select Firewall, click Settings, and then click Services.
    Choose the address range for your users’ computers from the “Edit Services for” pop-up menu.
    Select “Allow only traffic from ‘ipaddress’ to any of these ports,” select the Allow checkbox for Mobile Account Sync (port 2336), and then click Save.
    Select the server, click Settings, and then click General.
    Select “Server Side File Tracking for Mobile Home Sync” and then click Save.
    My questions is:
    In step 2, I added "Firewall" to the services. I continued with the following steps, but nowhere does it say to press the button "Start Firewall", so as of right now Firewall is listed, but not activated - it's gray and not green. Should I turn on the Firewall Service? In my setup, a cable modem/router is acting Firewall between WAN and LAN (small private home network).

    I can't get Server Side File Tracking to work. Any help would be greatly appreciated!
    Here's what I've done:
    1. Followed the instructions in "Mac OS X Server v10.6 - User Management" as per the first post in this thread.
    2. Tried turning on the Firewall Service - resulting in clients unable to log in to their network accounts.
    3. In Server Admin, under Firewall>Settings>Services, with 192.168-net selected in the pop-up menu entitled "Editing services for", I then chose "Allow all traffic" (instead of "Allow only traffic to these ports:") as my router acts as a Firewall in my setup. Now users can log in to their network accounts again, but Server Side File Tracking is still not working. How do I know it is not working?
    According to infinite vortex in this other thread, the syncing window is supposed to only show this:
    On my clients, you can see it scan through the home directory before the file copying/syncing actually starts.

  • How to install owb server-side software on UNIX Solaris (SPACR-64)?

    Hi there,
    How to install owb server-side software on UNIX Solaris (SPACR-64)?
    I've read the install guide
    and it mentions
    3. Start the installer by entering the following at the prompt:
    cd mount_point
    ./runInstaller
    I don't have access to any graphical interface on the UNIX box e.g. x-windows nor any cd with the software, just the solaris software downloaded from web - does this include the runinstaller
    and is the runisnatller just a command line interface?
    I hoped I would be able to download the software from oracle website and then simply run the a setup scrip?
    Is it possible to do this? Would I simply substitute cd mount_point to cd <directory I put software)
    I've never ran oracle universall installer on UNIX before.
    Many Thanks
    Edited by: user575470 on Feb 15, 2009 7:54 AM
    Edited by: user575470 on Feb 15, 2009 8:06 AM

    Hi,
    You can install the server-side software from the downloaded software.
    You don't need the CD
    You do need an X-windows client on your computer to connect to the server OR work directly on the server.
    Without X-windows you cannot start the Oracle Universal Installer.
    Maybe there is a command line installation, I have never used this.
    I hope this helps.
    Regards,
    Emile

  • How to read a whole text file into a pl/sql variable?

    Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?

    how to read a whole text file into a pl/sql variable?
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....

  • How to read data from a file that was formatted by excel?

    Hi everyone, I'm familiar with java.io and the ability to read from files, can anyone tell me how to read data from a file that was formatted by excel? Or at least give me some web references so that I can learn about it?

    http://jakarta.apache.org/poi/hssf/index.html
    HSSF stands for Horrible Spreadsheet Format, but it still works!

  • How to read text in .kep files

    hey friends,
    how to read text in .kep files
    please help me .
    with regards,
    s.jagadeesh babu

    Hi,
    check this link:
    http://help.sap.com/saphelp_nw04s/helpdata/en/8f/42a293e35011d29b340000e8a4b41d/content.htm
    .kep files are SapShow Training Files. They can be played with sapshow.exe in Knowledge Warehouse.
    SAP Show is KW Viewer Application. You can use it to see “Kep” files. It can be run in windows without the SAP environment. To run SAP Show (4.6D version) you just need 3 files. First is SAP show executable file, another two are “Sapstg.dll” and “ZLib.dll”. You can easily find these files on internet.
    Regards,
    Niraj

  • How to read a text/html file in java regardless of its encoding?

    Hi All,
    How to read a text/html file in java regardless of its encoding?
    1. Is there any way to identify that a file (read using FileInputStream/or any other means with java.io package) has been saved with which type of encoding i.e. whether the file is using ANSI encoding or Unicode encoding or other?
    2. Is there any standard way to read an encoded file (i.e. files having UTF-16 format for Asian locales character support) and un-encoded file (i.e. files having ordinary ANSI format) correctly without knowing the user input?
    The problem is that while creating an instance of 'InputStreamReader' (ISR) we can pass the encoding type used (otherwise it takes the system's default encoding type), and the ISR expects the file to be in the same encoding format otherwise it reads it as some junk. But we don't know which file the user is going to pass whether it is Unicode (for Asian locales file should be in Unicode) with or ANSI coded (for non-Asian / English locales user generally uses ANSI encoding).
    Regards,
    Sam

    1. There is no reliable way of guessing the encoding of a file without that information. Thats why XML for example has very strict rules wrt. it's encoding (short form: use UTF-8 or UTF-16, if you use anything else, you'll have to specify it)
    2. you might be able to make an educated guess if the possible range of encodings is limited, but it will probably never be 100% certain
    3. The HTML file might have a header entry "<meta http-equiv..." that tells you about it's encoding. You could try to read the start of the file and see if you find that, then if you found it re-read the entire file.
    regards

  • How to read the whole text file lines using FTP adapter

    Hi all,
    How to read the whole text file lines when error occured middle of the text file reading.
    after it is not reading the remaining lines . how to read the whole text file using FTP adapter
    pls can you help me

    Yes there is you need to use the uniqueMessageSeparator property. Have a look at the following link for its implementation.
    http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_file.htm#CIACDAAC
    cheers
    James

  • How to read HyperLinks from pdf file??

    hi developer's,
    I am in PDF processing... I am having doubt in that Processing.
    How to read Hyperlinks from PDF file?
    I can able to set the hyperlink.. But i cant able to get the hyperlinks..
    The following example program will set the hyperlink to the PDF file using lowagie API..
    import com.lowagie.text.Anchor;
    import com.lowagie.text.Chunk;
    import com.lowagie.text.Document;
    import com.lowagie.text.DocumentException;
    import com.lowagie.text.Paragraph;
    import com.lowagie.text.html.HtmlWriter;
    import com.lowagie.text.pdf.PdfReader;
    import com.lowagie.text.pdf.PdfWriter;
    public class Argu1 {
         public static void main(String[] args) {
              Document document = new Document();
              try {
                   PdfWriter pdf = PdfWriter.getInstance(document,
                             new FileOutputStream("PageLink.pdf"));
    PdfReader pdf_read=new                
                   document.open();
                   document.add(new Paragraph("Hi Everbody....!"));
                   Anchor pdfRef = new Anchor("Click Me");
                   pdfRef.setReference("www.java2s.com");
                   Anchor rtfRef = new Anchor("Touch Me");
                   rtfRef.setReference("www.sun.com");
                   System.out.println(rtfRef.reference());
                   document.add(pdfRef);
                   document.add(Chunk.NEWLINE);
                   document.add(rtfRef);
              } catch (DocumentException de) {
                   System.err.println(de.getMessage());
              } catch (IOException ioe) {
                   System.err.println(ioe.getMessage());
              document.close();
    Help me how to read the Hyperlinks from the PDF file using java ...
    Thanks in advance,
    With Regards,
    J.Imran

    Instead of cross-posting unformatted code you could have taken a look at the API, because there you might have come across a method named getLinks...Even though it's not documented, I really suspect that it will return the Hyperlinks on a given page.

  • How to read appended objects from file with ObjectInputStream?

    Hi to everyone. I'm new to Java so my question may look really stupid to most of you but I couldn't fined a solution by myself... I wanted to make an application, something like address book that is storing information about different people. So I decided to make a class that will hold the information for each person (for example: nickname, name, e-mail, web address and so on), then using the ObjectOutputStream the information will be save to a file. If I want to add a new record for a new person I'll simply append it to the already existing file. So far so good but soon I discovered that I can not read the appended objects using ObjectInputStream.
    What I mean is that if I create new file and then in one session save several objects to it using ObjectOutputStream they all will be read with no problem by ObjectInputStream. But after that if in a new session I append new objects they won't be read. The ObjectInputStream will read the objects from the first session after that IOException will be generated and the reading will stop just before the appended objects from the second session.
    The following is just a simple test it's not actual code from the program I was talking about. Instead of objects containing different kind of information I'm using only strings here. To use the program use as arguments in the console "w" to create new file followed by the file name and the strings you want save to the file (as objects). Example: "+w TestFile.obj Thats Just A Test+". Then to read it use "r" (for reading), followed by the file name. Example "+r TestFile.obj+". As a result you'll see that all the strings that are saved in the file can be successfully read back. Then do the same: "+w TestFile.obj Thats Second Test+" and then read again "+r TestFile.obj+". What will happen is that the strings only from the first sessions will be read and the ones from the second session will not.
    I am sorry for making this that long but I couldn't explain it more simple. If someone can give me a solution I'll be happy to hear it! ^.^ I'll also be glad if someone propose different approach of the problem! Here is the code:
    import java.io.*;
    class Fio
         public static void main(String[] args)
              try
                   if (args[0].equals("w"))
                        FileOutputStream fos = new FileOutputStream(args[1], true);
                        ObjectOutputStream oos = new ObjectOutputStream(fos);
                        for (int i = 2; i < args.length ; i++)
                             oos.writeObject(args);
                        fos.close();
                   else if (args[0].equals("r"))
                        FileInputStream fis = new FileInputStream(args[1]);
                        ObjectInputStream ois = new ObjectInputStream(fis);
                        for (int i = 0; i < fis.available(); i++)
                             System.out.println((String)ois.readObject());
                        fis.close();
                   else
                        System.out.println("Wrong args!");
              catch (IndexOutOfBoundsException exc)
                   System.out.println("You must use \"w\" or \"r\" followed by the file name as args!");
              catch (IOException exc)
                   System.out.println("I/O exception appeard!");
              catch (ClassNotFoundException exc)
                   System.out.println("Can not find the needed class");

    How to read appended objects from file with ObjectInputStream? The short answer is you can't.
    The long answer is you can if you put some work into it. The general outline would be to create a file with a format that will allow the storage of multiple streams within it. If you use a RandomAccessFile, you can create a header containing the length. If you use streams, you'll have to use a block protocol. The reason for this is that I don't think ObjectInputStream is guaranteed to read the same number of bytes ObjectOutputStream writes to it (e.g., it could skip ending padding or such).
    Next, you'll need to create an object that can return more InputStream objects, one per stream written to the file.
    Not trivial, but that's how you'd do it.

  • How to Read data from excel file without converting a excel file into .csv or any other format

    Hello,
    Can somebody suggest me how to read from an excel file (consisting of 10 work sheets) to an array?
    Thanks,
    She

    You have to be careful when using the spreadsheet-files vi's.  They are located in the Functions Palette under File IO, you will find "Write To / Read From Spreadsheet File.vi"s. 
    Here is what the Context Help says about the vi function:
    "Reads a specified number of lines or rows from a numeric text file beginning at a specified character offset and converts the data to a 2D, single-precision array of numbers. You optionally can transpose the array. The VI opens the file before reading from it and closes it afterwards. You can use this VI to read a spreadsheet file saved in text format. This VI calls the Spreadsheet String to Array function to convert the data. "
    This is quick & easy when the spreadsheet is all the same format.  You can set the format to string as well.  HOWEVER...  you do have to convert the Excel spreadsheet to text before using it.
    I haven't experimented with the Active-X, but it may look as the way to go if you have combination text / numeric values in the spreadsheet.
    If you did convert it to text, then you can use array functions as well and treating the file as an array of strings (see very brief example attached).  The example is to illustrate a point only  
    JLV
    Attachments:
    starting point for spreadsheet.vi ‏28 KB

  • How to read some images from file system with webdynpro for abap?

    Hi,experts,
    I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
    How to read some images from file system with webdynpro for abap?
    Thanks a lot!

    Hello Tao,
    The parameter
       icm/HTTP/file_access_<xx>
    may help you to access the pictures without any db-access.
    The following two links may help you to understand the other possibilities as well.
    The threads are covering BSP, but it should be useful for WebDynpro as well.
    /people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
    http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
    Best regards
    Christian

  • How to run the Server Side Existing rule in Exchange 2010

    Hi All,
    There were requirement to create a auto forward rule for almost more than 5000 users, which we did, but the we want to apply this rules to the messages which are already in the inbox for all those users where we have created the rule.
    Right now the problem what we are facing is for each individual we have to take full access to their mailbox and execute the rule first time and then it works.
    this is becoming challenging for us to making this for all 5000 users. the other problem is those user are not regularly login to this mailbox, they are using some other Org mailbox, so even we can not communicate to all of them.
    Q1) How to run the Server Side Command which should forcefully apply whatever rules is created for that user should execute for the messages which are already in the inbox.
    Q2) or the powershell for for specific rule name, which can apply on the for all the messages which are there in the inbox.
    Any help would be appriciated!
    Thanks in adv champions!
    Ashku

    Hi Ashku,
    If these 5000 users are all users in your Exchange organization, a inbox rule can be created by the following commands:
    Get-Mailbox | foreach {New-InboxRule -Mailbox $_.Name -Name AutoForward -From [email protected] -ForwardTo UserB}
    Based on my test, the Inbox rule created in server side also cannot work on the message that have already been in the Inbox unless users click “Run Rules Now…” in their Outlook client. And the transport rule in Exchange server only works
    during the message sending process.
    Therefore, there may be no feature in Exchange server side to meet your requirement.
    Thanks for your understanding.
    Thanks,
    Winnie Liang
    TechNet Community Support

Maybe you are looking for

  • Where can I find a tutorial to Excel features like using drop down tables and other little known features

    Using data from a table in an external sheet can be done but is tricky.  I would like to find rules supporting this feature.  Also, I'd like to find discussions of other little known features to improve and add sophistication to custom spreadsheets

  • How do I include a blank in an enumeration

    Hi - I have an element in my datatype that is length 1 and I would like to specify 2 enumeration values, X and blank. Essentially I want the following in my datatype XSD: <xsd:restriction base="xsd:string">   <xsd:maxLength value="1" />   <xsd:enumer

  • Mac Mail No Images

    My Mac Mail isn't showing any images in the messages themselves in any of my accounts. What setting could be the cause? I have checked, "Display remote images in HTML messages", but that doesn't seem to help. Where there should be images are instead

  • Any recommendation for how to run exe files in mac os!?

    I have an external hard drive which has a password that is a exe file. I figured if I could find an app that opens exe files it would be the best idea, but since I upgraded to mountain lion that app doesn't support mountain lion! any syggestiin guys?

  • How to Sync BB 8900 with Outlook 2007

    Hi, I just purchased the BB 8900 and Outlook 2007.  How do I sync my Outlook 2007 Calendar to my BB?  I think I am missing something!  I just don't know where to start.  Thanks for any help provided!