URL reading

Hi Everybody!
In the web enabled report I would like to read the URL from the
explorer. Is it able? Or does anybody know a way to give from a
web enabled form to a web enabled report parameter (only one
number, no other).
Thanx for your answer: D_niel
null

You should determine the resource's character encoding from the URL's content type header, and use that when creating the reader and writer. Whether that's what's causing the spacing to be different I don't know whether you mean space or linefeed, and you'd have to compare the byte values of the resource and the file you've generated to be sure what's changed.
Pete

Similar Messages

  • Unicode URL Reading

    Hi all, I'm just written a mini-program to read the title of a URL, and it works. Problem comes when it accesses a site that is not of English-language. I get garbage characters showing up if I use System.out.println on the title I've just read. It works with English characters though.
    How can I read in the non-language titles correctly? These include Korean, Chinese (Simplified), Chinese (Traditional) and Thai.
    Johnny

    t cThe problem is not with reading but with displaying.
    When chars of other lanuages are displayed the media that shows the chars should have a unicode font that support the language. So most of the non english chars will not work in console unless you change the font.

  • Https protocol based URL reading Program

    This is the simple code to read through a java program from a simple http based procot URL
    import java.net.*;
    import java.io.*;
    public class URLReader {
    public static void main(String[] args) throws Exception {
         URL yahoo = new URL("http://mail.yahoo.com/");
         BufferedReader in = new BufferedReader(
                        new InputStreamReader(
                        yahoo.openStream()));
         String inputLine;
         while ((inputLine = in.readLine()) != null)
         System.out.println(inputLine);
         in.close();
    But if i use the url https://mail.yahoo.com/ instead of http://mail.yahoo.com/ then i have an exception given below
    Exception in thread "main" java.io.IOException: HTTPS hostname wrong: should be
    <mail.yahoo.com>
    at sun.net.www.protocol.https.HttpsClient.b(DashoA12275)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA12275)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
    (DashoA12275)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:626)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Dash
    oA12275)
    at java.net.URL.openStream(URL.java:913)
    at URLReader.main(URLReader.java:7)
    Now i want this program based on https to run. SO can anybody help me running the same program by using https? Or can anybody give me the code to run a url based on https protocol?

    Here is a code which works for me.
    import java.net.*;
    import java.io.*;
    public class URLConnectionReader {
        public static void main(String[] args) throws Exception {
            URL myurl = new URL("https://my.app.com/");
            URLConnection yc = myurl.openConnection();
            BufferedReader in = new BufferedReader(
                                    new InputStreamReader(
                                    yc.getInputStream()));
            String inputLine;
            while ((inputLine = in.readLine()) != null)
                System.out.println(inputLine);
            in.close();
    }Output:
    <html><head>
    <script>location.replace("/my/app?action=homeActionId");</script>
    </head></html>

  • URL read - 502 error

    Hi,
    I am trying to read and write a file by using a URL. I have already tested the reading a write for the .doc file locally. However, when I tried it with the ULR I get.
    Server returned HTTP response code: 502 for URL:
    I check on the 502 error:
    502 Bad Gateway Used by servers that act as proxies or gateways; indicates that initial server got a bad response from the remote server.
    This sound like a timeout issue. When I tried link to the document with the URL throught IE, I get a popup "showing that the file may contain virus, Do you want to download anyway?" Is there a way I can turn this off from IE?
    TIA,

    Double-posted by accident:
    http://forum.java.sun.com/thread.jspa?threadID=664208

  • URL reading program

    Hello, with this program I am trying to get input (the content) from one or more urls and then print that content to a txt file or html file.
    This is my code so far, please could you advise or change the code so that it carries out the function I require.
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class URLReader
         public void process (String[] argStrings) throws Exception
              URL url;
              String fileName = argStrings[0];
              String contents = null;
              url = new URL(argStrings[0]);
              System.out.println();
              System.out.println("Conatenated contents of selected pages:");
              System.out.println();
              PrintStream output = new PrintStream("NewFile.txt");
              for (int index = 0; index < argStrings.length; index++)
                   Scanner sc = new Scanner(new File(argStrings[index]));
                   contents = sc.nextLine();
                System.out.println(contents);
                   output.println(contents);
                   sc.close();
    }Thanks anyone

    Thanks, it was not the exact code as I want to be able to specify the url 's on the command line but anyway that helped alot.
    Please check out my code and see whats wrong as it compiles ok but gives an error in dos.
    cheers
    // Import necessary classes
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class URLReader
         public void process (String[] argStrings) throws Exception
              // Declaring necessary variables
              String contents = null;
              URL url = new URL(argStrings[0]);
              BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
              // Asks user to input URL's to be concatenated
              System.out.println();
              System.out.println("Concatenated contents of selected pages:");
              System.out.println();
              // Opens file
              PrintStream output = new PrintStream("NewFile.txt");
              // Loop where all URL's content is read and then written to NewFile.txt
              for (int index = 0; index < argStrings.length; index++)
                   // New instance of scanner
                   Scanner sc = new Scanner(new File(argStrings[index]));
                   contents = sc.nextLine();
                System.out.println(contents);
                   output.println(contents);
                   sc.close();
    }

  • How to read URL by button action event

    Hi,
    Can some one please show me how to add a ...... I call it URL reader to the action of a button of another class?
    Lets say I have a url reader class and the following code
    public void uRLReader() throws Exception {
             // URL concatenation
             String url1 = "http://";
             String url2 = "";
             String url3 = ".google.com";
             URL google = new URL(url1+url2+url3);
             BufferedReader in = new BufferedReader(
                            new InputStreamReader(
                            google.openStream()));
             String inputLine;
             while ((inputLine = in.readLine()) != null)
                 System.out.println(inputLine);
             in.close();
            }Now I also got another class in the same package "class2", it has a button. Similarly, another class which has a JTextField. Now when some one writes 1 and hit the button I want "1" to get inserted into url in "url2" position. In other words any thing that is entered in the JTextField should be inserted into "url2" position.
    I am not very much familiar with java so this is all I could write. I used a string concatenation to break the url. Can some please show me how do I add this to the button of another class and the button to JTextFiled of another class?
    Thank you

    First of all, change your method so that url2 is an argument of the method:
    public void uRLReader(String url2) throws Exception {and remove the declaration of url2 from the body of the method.
    Then, write and ActionListener class (it could be an anonymous inner class) to read the textfield you want, then invoke uRLReader, passing that text as an argument.
    That's basically it.

  • Diffference between reading from URL and reading using Sockets

    Hi,
    For my AJAX call, if the URL is out side my domain, then I am not able to get the js and css for that url.
    what can be the other approaches to resolve this issue?
    again, what is the difference between reading from URL / reading from a socket connection?
    Does AJAX call through socket solve my problem??
    Your input is appreciated.
    Thank you,
    Regards,
    Chintan

    Converting Between a Filename Path and a URL
    Copying One File to Another

  • Can not copy a URL from the address bar/line

    Why is it proving so difficult for me to copy a URL from the address bar using Safari?  When I click on the link I want to copy, it does not highlight.  I have used Command L and Command C, and that works but there has to be a simpler way.  I also read that if I click the address bar once, then press the control key and click on it again that a menu would appear with cut, paste, copy.  That does happen, but all options are greyed out, and not selectable.  Another google search resulted in someone saying there was a button or arrow to click on and that this tool would copy the URL.
    The URL I am copying is very long, longer that the address bar window
    What Gives Here?

    Click the icon (favicon) to the left of the URL.
    That will select the entire URL.
    Command C will copy the URL.

  • Text input as variable in a URL

    I want to create a simple flash document with a text input
    field, and a button that will go to a URL. The trick is that the
    text input field needs to replace an element in the URL for
    personlaization purposes. I got the field, and I got the button.
    What is the method for getting it into the URL.

    I think you should be able to do something like, I use it for
    loading variables from a URL a lot and im pretty sure will work the
    same using getURL
    something like this, just change the variables to yours
    getURL("
    http://www.test.com/cgi-bin/scripts.pl/flash/search?name="
    + input_name_text.text + "&category=" + category + "&type="
    + category);
    Whatever is in those variables will be inserted into the
    URL.

  • How to read parameters from request object

    We want to read parameters from GET request
    but whenever we are calling GET_URI_PARAMETER from the REQUEST we don't see any results
    url is like
    http://coevi116.wdf.sap.corp:8000/sap(bD1lbiZjPTEwMA==)/bc/bsp/sap/z_test_json/jsontest.htm?PARAM=ABC
    But reading PARAM is not givng value of ABC
    onCreate and onRequest wherever we put the code it is not reading the value
    Can anyone please help and share some expert opinion

    in jsontest.htm page create a page attribute named "PARAM" with auto check box checked and check in oninitialization, this will carry the value passed to param from url.

  • Powershell: There is no file with URL error during file upload.

    I am trying to put together a PowerShell script that I could use to upload files from a local directory, into a Document Library in a Record Center Site. Here is what my script looks like...
    #Open web and library
    $web = Get-SPWeb $webUrl
    $docLibrary = $web.Lists[$docLibraryName]
    $files = ([System.IO.DirectoryInfo] (Get-Item $localFolderPath)).GetFiles()
    Write-Host "Local Directory:" $localFolderPath
    ForEach($file in $files)
    Write-Host "Looping through files"
    Write-Host "Current file:" $file
    ElseIf ($contentType = "MyContentType")
    #Open file
    $fileStream = ([System.IO.FileInfo] (Get-Item $file.FullName)).OpenRead()
    # Gather the file name
    $FileName = $File.Name
    #remove file extension
    $NewName = [IO.Path]::GetFileNameWithoutExtension($FileName)
    #split the file name by the "-" character
    $FileNameArray = $NewName.split("_")
    $check = $FileNameArray.Length
    #Add file
    $folder = $web.getfolder($docLibraryUrlName)
    write-host "Copying file " $file.Name " to " $folder.ServerRelativeUrl "..."
    $spFile = $folder.Files.Add($folder.Url + "/" + $file.Name, [System.IO.Stream]$fileStream, $true)
    $spItem = $spFile.Item
    write-host "Success"
    #populate columns
    $spItem["Application Number"] = $FileNameArray[0].ToString()
    $spItem["Site Number"] = $FileNameArray[1].ToString()
    $spItem.Update()
    $fileStream.Close();
    Each time I run my script, I get this error message 
    Exception calling "Add" with "3" argument(s): "<nativehr>0x80070003</nativehr><nativestack></nativestack>There is no file with URL 'http://myRecordLibrarySite/myRecord Library/12587_B2317.PDF' in this Web."
    At C:\powershellscripts\Upload-FilesIntoSharePoint.ps1:72 char:6
    +                     $spFile = $folder.Files.Add($folder.Url + "/" + $file.Name, [System.IO.Stre ...
    +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : DirectoryNotFoundException
    I have not been able to nail down why the script is failing. Any ideas why? Thanks for the help.

    I just figured out the issue with adding the file. I went in this direction, and my code has progressed forward.
    $folder = $web.getfolder($docLibrary.rootFolder.URL)

  • Safari doesn't open URLs

    Hello guys,
    I have Safari 5.0.6. and it sometimes fails to open pages, websites, whatever URL I enter, except Google.
    Google is my default browser, so when I launch Safari, Google site opens. But then it does not open anything after that.
    When I reset it, it works fine for while, then it starts to fail open pages again.
    Any idea what it might be and how to fix it?
    Thank you fo r any advise.

    Anita --
    Can you open this?
    http://www.englishforfun.es
    The other file is actually a PDF, not a URL.

  • Personal Domain - Can I get rid of my iWeb site's name in the URL?

    Hey everyone,
    I just set up my iWeb site (called "This is Out of Context") to point to a personal domain name (www.thisisoutofcontext.com). Problem is, now my homepage URL reads: http://www.thisisoutofcontext.com/THISIS_OUT_OFCONTEXT/HOME.html
    Is there any way to "get rid" of the second "THISIS_OUT_OFCONTEXT" so that my URL simply reads: http://www.thisisoutofcontext.com/HOME.html ? You know...short 'n sweet...like a "normal" website?
    Any thoughts or tips would be much appreciated (please go easy on me, I'm a total newbie here...)
    Cheers!

    does this work with iweb 08?
    my site was running fine until i upgraded to iweb 08 and redsigned my site. i have a godaddy account for my domain name and i have it masked and forwarded but my apple url still appears at the top of the browser bar while in safari and firefox. my site is www.louislemoine.com
    if you go there you will see what i mean. maybe what you are talking about will solve this problem. i am at work so i can not check to see if what you talk about will work. i am hoping that you are onto something.

  • URL not found error while loading photo on Linux

    Hi,
    I have a AIR 2.0 appliaction which works perfectly well on Windows but while I run it on Linux Loader object can't load any photo. I tried many path variations but I always get Error #2035: URL Not Found.
    Here's how I load a photo (with hard coded URL)
    _imageLoader.load(new URLRequest("/home/piotr/105755/damage_photos/17.jpg"));
    I'm sure that "/home/piotr/105755/damage_photos/" path is correct. I pasted it to files explorer address text input and expected directory was opend. I'm also sure that 17.jpg file exists in that directory.
    When I trace IOError message it says: Error #2035: URL Not Found. URL: app:/home/piotr/105755/damage_photos/17.jpg
    My questions are:
    What "app:" does in my URL... can it cause the problem? If yes, how can I get rid of it?
    Is there anything specific about UNIX systems and Loader that should I know about?
    How can I load file from hard drive other way than by Loader object?
    I use AIR 2.0 SKD, Flex 4.5 SKD and Ubuntu 10.04. Could anyone help me, please?

    Hi,
    Just a test, can you try to do this:
    var f:File = new File(File.userDirectory.nativePath+File.separator+"105755"+File.separator+"damage_photos" +File.separator+"17.jpg");
    _imageLoader.load(new URLRequest(f.url));

  • Setting the webservice url at run time for a execute button in adobe form

    Hi,
    I am using Data connection from the wsdl file to interact with the backend, the button generated from the data connection is of type execute which has the url of the webservice in the object property "Webservice URL" and name of the FM in the interface name. My problem is at present the form is working fine but when the same form transported to QA and PRD them the url of the webservice gets change. hence the same button wont function.
    The solution is either we do the changes manually in all the system or pass the url at run time. Please proide me the solution if there is a way to set this url in the execute button at runtime.
    Thanks in advance.
    Pooja

    Why don't you pass in the URL via an XML input file and bind a hidden text field in your form to that element in your XML? Then use javascript to modify the docReady event of the submit button to something like this:
    var url = textFieldWithURL.rawValue;
    this.event__click.submit.target = url;

Maybe you are looking for

  • Industrial Design & CAD -- Switching to Mac (Within A Company)

    Hi all. With the stalled global economy, our IT budget is frozen here at my company, probably for at least a year. So, what better time to ressurect my case for Macs at work to replace our Dells? If you can help, please read on... I'm an industrial d

  • % Excise Duty is coming wrong in Report

    Hi, I have a report of Gross Margin (FI).... My problem is that when i m picking the % Excise Duty from J_1IEXCTAX table against the Chapter ID....it is showing the 4 values against it...means 4 time % Excise Duty....i.e. periodic changed... like....

  • IMac 27 Late 2009 with Random black screen at startup of Windows 7!

    Hi, I'll try to explain the my random black screen issue as best I can. I have a boot camp partition with Windows 7 x64 Ultimate installed. I used the USB method to install, all goes well and Windows 7 gets installed, I update drivers, install boot c

  • The Apps Won't Show

    Hi, I'm Julia. I have a Blackberry Curve 8520. Somehow, when I press the button that is supposed to bring me to my apps, it won't show anything. It just stays on my home screen. Does anyone know a way on how to get them to show, because I have import

  • Ideacentre A310

    Help please anyone!  Where can I get a replacement wireless keyboard for my IdeaCentre A310 in the UK? Dog has eaten it!! Product number A310-K BT.  Thanks in advance to anyone who can help.