Hi again,

Sorry for the barrage of messages from me recently but it's obviously
early days for BASE 2 and whenever I have got stuck recently there
hasn't been any existing messages to fall back on. I guess this will
improve over time....

I am trying to write some code to do a combined zip file upload and
batch data import. Our users have large experiments with sometimes up to
100 files so this is badly needed. 

The way I want to go about this is as follows:
- upload a zip file containing all the raw data files
- create a new subdirectory in the user's "raw data" directory which has
the same name as the zip file (minus the extension obviously)
- then create a RawBioAssay object for each file in that directory

I am driving all this from a couple of custom JSP pages that I am
inserting into the BASE JSP tree. I have modified my copy of menu.jsp to
include an extra item that allows the user to select this. 

I am having trouble creating the subdirectory programmatically. I have
used the following code to do this:

Directory dataDir = Directory.getByPath(dc, new
Path(homeDir.getPath().toString()+"/raw data",Path.Type.DIRECTORY));

Directory subDir = Directory.getNew(dc,dataDir);                        
String fileName = uploadedFile.getFilename();
String fileNameNoExt = fileName.substring(0, fileName.indexOf("."));
subDir.setName(fileNameNoExt);
subDir.checkPermission(Permission.CREATE);

.....but I am getting the following exception:

net.sf.basedb.core.PermissionDeniedException: Permission denied: Not
allowed to create Directory

I have also tried this alternative method

Directory subDir = dataDir.newSubDirectory();

with the same outcome. I also tried creating the subdir directly below
the user's home dir and the same thing happens. 

I have checked my test user's role and it is set to User which
supposedly includes permission to create directories, according to the
listing you get. I have also tried setting this user's status to
administrator but that makes no difference.

Can someone help me out with this please?

Many thanks

Micha

==================================
Dr Micha M Bayer
Bioinformatics Specialist
Genetics Programme
The Scottish Crop Research Institute
Invergowrie
Dundee
DD2 5DA
Scotland, UK
Telephone +44(0)1382 562731 ext. 2309
Fax +44(0)1382 562426
http://www.scri.sari.ac.uk/MichaBayer.htm
=============================
 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

DISCLAIMER:

This email is from the Scottish Crop Research Institute, but the views 
expressed by the sender are not necessarily the views of SCRI and its 
subsidiaries.  This email and any files transmitted with it are confidential 
to the intended recipient at the e-mail address to which it has been 
addressed.  It may not be disclosed or used by any other than that addressee.
If you are not the intended recipient you are requested to preserve this 
confidentiality and you must not use, disclose, copy, print or rely on this 
e-mail in any way. Please notify [EMAIL PROTECTED] quoting the 
name of the sender and delete the email from your system.

Although SCRI has taken reasonable precautions to ensure no viruses are 
present in this email, neither the Institute nor the sender accepts any 
responsibility for any viruses, and it is your responsibility to scan the email 
and the attachments (if any).


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
The BASE general discussion mailing list
basedb-users@lists.sourceforge.net
unsubscribe: send a mail with subject "unsubscribe" to
[EMAIL PROTECTED]

Reply via email to