How to write text to a file with GWT on the client side?

Is there a way to implement a write / read file with gwt on the client side? I tried with java.io.File, java.io.Writer ... I failed.

thanks in advance!

Update: see my own answer for the solution

+3
source share
4 answers

I recently came across a library called client-io .

A simple library that brings the flash file APIs to regular web applications through GWT. ClientIO helps you offload part of the generation file for the client, saving resources and computing to the server. Working demo - http://ahome-it.imtqy.com/ahome-client-io/

+3
source

, . GWT Java. IO RPC - -.

+9

HTML5 . lib-gwt-file. DND. , . HTML5 FileAPI .

, URI . . Google Chrome. . :

public static native void setWindowHref(String url)/*-{
    $wnd.location.href = url;
}-*/;

- Downloadify. . .

+5
source

In GWT, classes in the client folder are compiled only in javascript, so you cannot use

java.io

since GWT does not provide package compilation

java.io

Therefore, you should write a text file only through RPC.

0
source

Source: https://habr.com/ru/post/1795342/


All Articles