Link to home
Start Free TrialLog in
Avatar of krishna kishore mellacheruvu venkata
krishna kishore mellacheruvu venkataFlag for India

asked on

Require help setting URL as Java String Variable

public static void main(String args[]) throws Exception
   {
      String url = "https://elasticbeanstalk-us-east-1-190553128079.s3.amazonaws.com//Employee//Employee.xlsx";


      try
      {
         FileInputStream fis = new FileInputStream(url);
         System.out.println("fis"+fis);
      }catch(Exception e)
      {
         e.printStackTrace();
      }
   }

I am getting following Error

java.io.FileNotFoundException: https:\elasticbeanstalk-us-east-1-190553128079.s3.amazonaws.com\Employee\Employee.xlsx (The filename, directory name, or volume label syntax is incorrect)
   at java.io.FileInputStream.open0(Native Method)
   at java.io.FileInputStream.open(FileInputStream.java:195)
   at java.io.FileInputStream.<init>(FileInputStream.java:138)
   at java.io.FileInputStream.<init>(FileInputStream.java:93)
   at com.webproject.HelloWorld.main(HelloWorld.java:20)

Please help

File need to read as  https:\elasticbeanstalk-us-east-1-190553128079.s3.amazonaws.com\Employee\Employee.xlsx

ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Dake
Jeffrey Dake
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of krishna kishore mellacheruvu venkata

ASKER

Thank you for help. It worked
Glad I could help