How to treat URL as a local file

Hi,
I am working on an existing piece of code. The whole code has been designed in such a way that all the methods take file as the argument. for example getMiMeType(File F) ........However, now my function is to add streaming capabilities so that lets say i can run the file http://www.xyz.com/ix.mpg and use the existing methods instead of writing new ones, how can i do that. Help Appreciated.

Fair enough, these are basically media files that will be read and then played. At the moment the application is stand alone so all the functions take arguments as files. Now however, if I want to add a file which is on lets say at some webserver, then i have got the problem. Because i cant find a way to treat the URL as a local file. However, the idea of extending the java.io.FIle is good but still too long.

Similar Messages

  • How do we create Hyperlink to local file on c:\ in Web Intelligence

    How de we create Hyperlink to local file on c:\ in Web Intelligence.
    Thanks in advance,
    K.

    K,
    You can't hyperlink to a local file when you are in WebI.  The ability to hyperlink requires the http protocol to be employed, wrapped within a web service (like IIS, for instance).  So to hyperlink to any file, that file must be a part of a web service, and the web service must have access to the folder (again, like in IIS you must create web shares and IIS must "mount" those shares in an http environment).  Hopefully I'm making sense to you on why it can't be done. 
    On the other hand, content that is static and has been made available for browsing on the web can also be linked to by populating a cell in a WebI report, marking that cell as "read cell contents as hyperlink", etc, etc.
    Thanks,
    John

  • How can i make hyperlink to local file for dowloading

    How can I make hyperlink to a local file for downloading it, it seams that only www links work in web Ui.
    Thanks

    If we assume that you have a LabVIEW application running on your cRIO that is exposing some data through web services, there are a couple of possibilities.
    You can create a web service call that returns the log data. In order for the browser to treat this as a file, you must set the correct content type in the http header. To do this you can't use the default form of data output. Instead you must create an "httpRequestID" input to your web service VI. With this you can call "Write Response.vi" to give the log data and "Set HTTP Header.vi" to specify the type (text/text probably works for a log). You can look at "examples\comm\webservices\address book\FindContacts.vi" to see an example of calling these 2 VIs. Once you create that web service entry point, you can set that as the URL of the hyperlink control and it should work.
    Another option is to have the cRIO application write to a log file that is under the root of the web server running on the machine. (This is the same place the xap for your Web UI Builder application is put.) This file could then be served up through the web server just like any other file.
    With either of these solutions there may be concerns about the browser caching results rather than requesting new content each time. There are additional values that can be set in the http headers with the first solution that can help with this, but I think there is still some variation between browsers.

  • URL for viewing local files

    I'd been using Browserlab successfully today, viewing local files from Dreamweaver CS5. I logged out and then returned later in the day and am now having problems as the Browserlab window is failing to  automatically load the local file's URL in the box at the top of Browserlab screen (the URL box just stays blank. Can I manually input the local address and if so can someone advise the general format. I assume something like http://localhost/.... Obviously I will need to input my own file names, but just need the root URL/general format for viewing local files.
    Thanks

    Hi flowersplash,
    Thank you for your interest in BrowserLab.  Please check to see if you have the BrowserLab web site open in another browser or browser tab.  You should only have one instance of BrowserLab open at a time.  You might also try restarting your browser (all instances) and Dreamweaver and if that doesn't work, the OS.
    BrowserLab currently only allows you to specify local or firewalled URLs from Dreamweaver.  Directly inputting a URL into the BrowserLab testing interface will test the page from the perspective of a person elsewhere on the Internet.  Open the site you want to test in Dreamweaver LiveView, select "Local" in the BrowserLab Panel in Dreamweaver and click the Preview button.
    Cheers,
    Josh

  • How to get access to the local file system when running with Web Start

    I'm trying to create a JavaFX app that reads and writes image files to the local file system. Unfortunately, when I run it using the JNLP file that NetBeans generates, I get access permission errors when I try to create an Image object from a .png file.
    Is there any way to make this work in Netbeans? I assume I need to sign the jar or something? I tried turning "Enable Web Start" on in the application settings, and "self-sign by generated key", but that made it so the app wouldn't launch at all using the JNLP file.

    Same as usual as with any other web start app : sign the app or modify the policies of the local JRE. Better sign the app with a temp certificate.
    As for the 2nd error (signed app does not launch), I have no idea as I haven't tried using JWS with FX 2.0 yet. Try to activate console and loggin in Java's control panel options (in W7, JWS logs are in c:\users\<userid>\appdata\LocalLow\Sun\Java\Deployment\log) and see if anything appear here.
    Anyway JWS errors are notoriously not easy to figure out and the whole technology in itself is temperamental. Find the tool named JaNeLA on the web it will help you analyze syntax error in your JNLP (though it is not aware of the new syntax introduced for FX 2.0 and may produce lots of errors on those) and head to the JWS forum (Java Web Start & JNLP Andrew Thompson who dwells over there is the author of JaNeLA).

  • Download a PDF from an URL to a local file

    Hi all,
    we are trying to get a pdf file from the internet with FM HTTP_GET, and after that download to a local file with WS_DOWNLOAD.
    Our problem is that we do not know wich type of table to use in order to retrieve the RESPONSE_ENTITY_BODY from HTTP_GET.
    Sometimes the PDF have 4000 of length sometimes 1200.
    Could you please help us?
    Regards,
    Rubé

    hi
    you can have a look at RSHTTP* programs.thta is ,for cl_http_client demo program try RSHTTP01 and for http_get demo program try RSHTTP20.
    hope this helps
    regards
    Aakash Banga

  • How to make applet access a local file in intranet?

    I want to have my applet read from and write to a file on the user's PC. This is our company's intranet and security is not a concern so we don't want to go through the complicated certificate procedure.
    Our application server is weblogic. The jsp containing the applet can be accessed at http://10.150.20.100:7001/slfweb/jsp/Home.jsp. According to Core Java (Volume II), I put the following paragragh into java.policy file under jre/1.3.1/lib/security dir of each user's PC, hoping this will grant the permission for the applet to read/write a file in tmp dir:
    grant codeBase "10.150.20.100:7001/slfpweb/" {
    permission java.io.FilePermission "C:\\tmp\\*", "read, write";
    However, it does not work. Can someone tell me what is the simplest way to allow an applet to read/write a local file in intranet system?
    Thank you very much!
    Ming

    I guess the reason you're still running into permission problem is that you have not addressed the required settings in the browser(s) that you're using.
    On everyone's PC, the following must be done:
    1) on IE, click Tools | Internet Options | Security . Under Trusted Sites, add your server's IP address. Under Local Intranet, reset it to Medium or Low and check to see if any of the relavant settings require attention (note that a Java Applet is equivalent to an ActiveX object in IE) . Finally, go into Java Custom Settings and make the appropriate changes.
    2) on NN, to access local files, you can enable Codebase Principals by adding the following line to the user's pref.js file (look for it where NN is installed -- usually under C:\Program Files):
    user_pref("signed.applets.codebase_principal_support", true);
    I have also read Core Java and found that the authors have a way of over-simplifying everything and failure to adequately describe other factors that may potentially affect what they're describing.
    V.V.
    PS: Signing an applet with a self-signed certificate is not all that difficult. Here is a link to my file i/o applet that contains pertinent info that you might want to look into:
    http://home.attbi.com/~aokabc/FileIO/FileIOdemo.htm

  • QuickView (run in backgroud) - How to auto save data to local file

    I am using Quickview to extract data. I want to run the Quickview query in background and auto save the data extracted into local file (ASCII file). Currently when I specify File Store (as my Output Format) and enter a file name (e.g C:\Temp\test.asc). Upon completion of extraction there is a little window popup that need me to select data format (e.g DAT, ASC) and click <Transfer> button to proceed to save data into local file.
    Is there a way that I can save data into local file without have to manually select ASC data format and click <Transfer> button. I will not be  able to schedule my QuickView query to run in background if I can't resolve this problem.
    Note that I don't have access to ABAP programming, therefore this option is out.
    Thanks in advance to anybody who can share your expertise experience.

    Tyr Fm's
    1. WS_UPLOAD
    2. GUI_UPLOAD
    But using gui_upload and ws_upload can only upload data from txt.
    actualy we have software to convert pdf to text file it freely availabe in internet...
    after conversion you can use thesr fms.
    plzz reward points usefull
    Cheers,
    Chandru

  • How to save object to a local file.

    Hello all.
    I need to save an object, i.e. an ABAP program, to a local file and then be able to "import" it into another system.
    I am not talking about the lines of codes that can be saved as a local file, but the whole program including screens and so on. Something similar to releasing a transport with object R3TR PROG ZMYPROGRAM to another system, but instead to the local desktop.
    Anyone would know if this can be done?
    Regards
    Lande

    Hi,
    Vist the Link for complete Download there are some utility programs.
    http://www.dalestech.com
    Regards
    vijay

  • URL of a local file

    Hi java experts.
    I have a function which takes URL as a parameter. But the file I want it to supply is on local hard drive. my file path is e:\administrator\source\defualt.htm. how to represent this file as a url string.
    Thank you.

    Try "file://e|/administrator/source/defualt.htm".
    If you just want the URL object and don't care about the actual string you can use new File(path).toURL().

  • How to get URL of a certain file and use it as an attribute value?

    Hello, I am using JDeveloper 11.1.2.3.0
    I want to get the URL of a file and use it as input of another attribute. I used inputFile but I can not get the URL directly from there. Do I have to build a managedBean? Can anyone help me with an idea on how to do this? If you could help me with a simple method it would be great.
    Thank you

    Hi,
    seems to need to step back for a moment and learn about how file input works if you don't know how to access the uploaded file. Please read
    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
    Frank

  • How to use flash player with local files?

    Have thumb drive with multiple *.flv and *.SWF files. Installed Flash player V11 today. If an FLV file is selected, nothing opens. How to connect these lecture type files with a player? Windows XP. Thanks.

    Local SWF files can be played with the standalone player (Projector) from http://www.adobe.com/support/flashplayer/downloads.html
    Note that the download is the player, not an installer.
    FLV files can be played with Adobe Media Player, which is no longer supported.  Use a 3rd party player such as VLC media player.

  • How to add url to a png file in fireworks?

    I am making a web banner that is 728X90. I want to add a url to the banner so that when you click on it, no matter what state it is on, the link will take you to the website? I just started using fireworks 3 days ago. Please explain in the simplest of terms how to add the url to the banner.
    Also when I drag the file to a new window in Chrome to preview it some of the elements are resized and out of place. How can I fix this?

    Here is a link to the file.
    file:///C:/Users/ACIJ/Pictures/Working%20Product.swf
    See how the words are going off of the banner. In Fireworks its fine. The words all fit but when it shows up in the browser it does not fit.

  • How to add URL links in XML file?

    Hi,
    I'm having problem with adding the URL links to the flash output. I'm using the XML file to call images and then the corrsponding links. Images are called correctly but when I try to add a link I'm not getting the links, but instead getting the HTML anchor tags as texts. I'm using the XML escape characters to escape the HTML tags but the results are not what I need.
    I'm using the following code:
    <thumbnail preview="large.jpg" thumb="thumb.jpg">
                <title><![CDATA[Finance Services]]></title>
                <discription><![CDATA[&lt;a href=&quot;http://www.google.ca">Google</a>]]></discription>
    </thumbnail>
    Output:
    Images are displayed correctly, but instead of getting the links, I'm getting following text message:
    <a href="http://www.google.ca">Google</a>
    I need to find out what I'm doing wrong. Am I using the correct way to add the links or not?
    Thanks for your time.

    I'm using following code for the Description part, where I need to place the HTML tags:
    var _discription:TextField = previewHolder.discriptionText.discriptionText;
    _discription.htmlText = _xml.thumbnails.thumbnail[photoNum].discription.toString()
    I'm using the htmlText, I tried replacing htmlText with tf.htmlText, but it didn't work. I'm importing the text field using import flash.text.TextField; do I need to import something for HTML tags to work?

  • How do I restore Elements 10  Locales file?

    In PSE 10, the driver file for Locales en_Us was lost when HP eAll-in One printer was installed.  I need to Copy the Twain driver to that location but now file is no longer there. What can I do?

    I believe twain drive is available in location C:\Program Files (x86)\Adobe\Photoshop Elements 10\Optional Plug-Ins\Import-Export and not in the locale folder.

Maybe you are looking for

  • Contacts groups

    How do you create groups and add contacts into it in iOS 6

  • Cannot connect to control panel

    I dont know if this is the right place to post this but up until today I can no longer use a custom ip adress or anything like that and http://192.168.1.1 wont even connect for me anymore it just sais it has timed out. does anyone have any clue how I

  • Accounting data missing

    Hi all, I'm getting an error called 'GL account is missing (1) Message 131-46' at the time of passing AR credit Memo by referring an AR invoice.  Please let me know the way to tackle this error and also let me know the general accounts to be determin

  • Photoshop + lightroom installation order

    Hi!  I just bought cs4 and lr2, and I was wondering if there is a preferred order they should be installed in.  Thanks for your help!

  • Flash Player Debug version failing to connect

    Sometimes while debugging I get the following error (see in attachment) The only issue I found was to replace in the eclipse folder the FlashPlayer.exe by the Debug version downloaded from adobe, and it works after that. But the error comes again and