Re: Get file on server with a pattern

2010-05-19 Thread Lorris
Thank you for your answer,

This is my solution if another people need it :

This is the content of my RPC method in server side.

String realPath =
getServletContext().getRealPath(/).concat(gwtModuleName); // Or
other folder you want to access
File f = new File(realPath);
for (String s : f.list()) {
if (s.matches(PATTERN)) {
// Do the job
}
}

Hope this will help.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Get file on server with a pattern

2010-05-18 Thread Lorris
Hello,

I'd like to know if it's possible with GWT to get files on server but
without known their names but with a pattern (like menus*.xml for
example).

I did this with success but that need to know the file name to get

RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,
fileName.xml);
try {
requestBuilder.sendRequest(null, new RequestCallback() {
public void onError(final Request request, final
Throwable exception) {
}

public void onResponseReceived(final Request request,
final Response response) {
String text = response.getText();
//Do anything
}
});
} catch (RequestException ex) {
}


But i don't know if I can get all the files matching to my pattern or
maybe get the list of file name and test my pattern for each of them.

Thank you for your time. (and sorry for my english)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Get file on server with name template.

2010-05-18 Thread Lorris
Hi,

I'm trying to get many files from the server but the problem is I
don't know their name, the only thing I know is the template of their
name (menus.*.xml).

I build a requestbuilder to get a file but this method needs the
really name of the file.

So i am searching a way to get file matching with my pattern or just
get the list of name file on server to compare with my pattern.

I hope you understand my problem.

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.