Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

FileDialog in applet

Posted on 1998-05-11
11
Medium Priority
?
1,221 Views
Last Modified: 2013-11-23
Is it possible to have a Dialog
like FileDialog that reads from the Directory
of the HTTP-Host the applet is coming from?
0
Comment
Question by:felgen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
11 Comments
 

Expert Comment

by:prg022698
ID: 1220920
Yes if you build one, No otherwise. At least not that I know of
0
 

Author Comment

by:felgen
ID: 1220921
I've tried to use the FileDialog class.
Running from within Development-Tool it certainly worked
because in that case the "file" protokoll was used.
Running within a browser I got a java.lang.NullPointerException
(shouldn't it be a SecurityException).
I've set the working directory of the filedialog to the directory
the applet was comming from. My idea was, that this directory
can be read from the applet.
What is the difference between the FileDialog class and
a class build by myself?

0
 
LVL 6

Expert Comment

by:gadio
ID: 1220922
 felgen, in order that the applet will be able to read (opening a file dialog is local disk read) it must be signed. I don't think that there is a difference in the IO operation that you might do opening a FileDialog and building a filedialog yourself. There are fue options for you to use:
1. Sign the applet with a test certification autority.
2. Buy a certification autority and sign the applet with it.
3. Enable the brawser to work with the applet as if its signed.
All of these options are different for Netscape and for IE. Note that for the distribution of your applet only option 2 is relevant. If you want some more info about some of these options for a given browser, I'll add a comment about it here.

G.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:felgen
ID: 1220923
Signed Applet requires jdk1.1.x, right?
I want to do it with jdk1.0.x.
0
 
LVL 6

Expert Comment

by:gadio
ID: 1220924
felgen, I think that you will have to compromise here. You can't open the security model for applets without signing the applet or opening the brawser to look at an applet/site as trusted (only in the latest versions of the brawsers).
0
 

Author Comment

by:felgen
ID: 1220925
I've a additional question. A signed Applet can read and write
from the client filesystem, e.g. with the class FileDialog, but
how can I get access to the filesystem of the host the applet came from and is this access for unsigned Applets restricted
through the Security Model.
0
 
LVL 6

Expert Comment

by:gadio
ID: 1220926
 If you want the applet to access the host file system you can do:
1. Open a file on the host as a url (that is good only if the file is in the part of the filesystems that is mapped by the http server).
2. Use CGI-BIN.
3. Use servlet.
All of these options are not restricted by the security model (if you are addressing the host). The first one is only client side code, and the other two are server and client side code.

0
 

Author Comment

by:felgen
ID: 1220927
My intension was not to read from a file in the filesystem of the HTTP-Server.
I only wanted to use the FileDialog class to browse through the filesystem and get
back path informations of a file. It would be nice if there is a possibility to change
the behavior of the class FileDialog or to use the corresponding peer.
0
 
LVL 4

Expert Comment

by:evijay
ID: 1220928
In future, the swing JFileChooser (FileDialog in swing) in com.sun.java.swing.preview package will be extended to handle URL's and this will solve your problem. Until then, try to rework swing source code and find a way to handle your problem.
You definetely need a proxy (a servlet or a file server) on the host you are working on. Its quiet a complex problem to solve.

best thing is developing yourself a poor man's file dialog which serves your purpose.

0
 
LVL 4

Accepted Solution

by:
evijay earned 200 total points
ID: 1220929
The answer is no such facility builtin the filedialog. You need to implement your own file dialog and a proxy server which serves the file details on the host.
see swing source for implementing a filedialog and java telnet applet for implementing a proxy server.

combine the too and implement the file dialog;
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question