๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.lenguajes.java
Article #29117

Re: Acceso a un fichero

#29117
From: Juan Antonio
Date: Thu, 15 Jan 1998 00:00
51 lines
1991 bytes
This is a multi-part message in MIME format.
--------------BB0DD0E960BFB4A107721ACA
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

alfonso1 wrote:

>     Hola quisiera que alguien me pudiera responder sobre la posibilidad
> de crear un APPLET, que acceda a un fichero y lo muestre por el browser.
>
>     El fichero reside en la misma direcci๏ฟฝn donde se encuentra el
> applet, y el applet ha de abrirlo y mostar su contenido.
>     No tengo mucha idea sobre este tema y necesitaria que alguien me
> hechara una mano.
>
>                 alfonso1@vw-gedas.es            Pep :-)
>
>

Para leer un fichero existente del servidor tienes que hacer lo siguiente:

URL fileURL;
InputStream input;
DataInputStream datainput;

fileURL = new URL("http://servidor/fichero");
input=fileURL.openStream();
datainput= new DataInputStream(input);

y a partir de aqui ya puedes leer.
texto=datainput.readLine(); o como tu quieras leer.


--------------BB0DD0E960BFB4A107721ACA
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Juan Antonio M.M.
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Juan Antonio M.M.
n:              M.M.;Juan Antonio
email;internet: juan@proton.uab.es
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------BB0DD0E960BFB4A107721ACA--
Technical Details
Message-ID: <34BE1D35.A4D0667F@proton.uab.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <34BE01B8.16F4A668@vw-gedas.es>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: 1116f3,3789d81ff8b21453
X-Google-Attributes: gid1116f3,public
From: Juan Antonio <juan@proton.uab.es>
Subject: Re: Acceso a un fichero
Date: 1998/01/15
Message-ID: <34BE1D35.A4D0667F@proton.uab.es>
X-Deja-AN: 316207018
References: <34BE01B8.16F4A668@vw-gedas.es>
Mime-Version: 1.0
Distribution: inet
Content-Type: multipart/mixed; boundary="------------BB0DD0E960BFB4A107721ACA"
Organization: JA
Newsgroups: es.comp.lenguajes.java