1385 |
02 Sep 11 |
martin |
1 |
/** |
1385 |
02 Sep 11 |
martin |
$Id: |
1385 |
02 Sep 11 |
martin |
3 |
|
1385 |
02 Sep 11 |
martin |
Copyright (C) 2011 Martin Svensson |
1385 |
02 Sep 11 |
martin |
5 |
|
1385 |
02 Sep 11 |
martin |
This file is part of BASE - BioArray Software Environment. |
1385 |
02 Sep 11 |
martin |
Available at http://base.thep.lu.se/ |
1385 |
02 Sep 11 |
martin |
8 |
|
1385 |
02 Sep 11 |
martin |
BASE is free software; you can redistribute it and/or |
1385 |
02 Sep 11 |
martin |
modify it under the terms of the GNU General Public License |
1385 |
02 Sep 11 |
martin |
as published by the Free Software Foundation; either version 3 |
1385 |
02 Sep 11 |
martin |
of the License, or (at your option) any later version. |
1385 |
02 Sep 11 |
martin |
13 |
|
1385 |
02 Sep 11 |
martin |
BASE is distributed in the hope that it will be useful, |
1385 |
02 Sep 11 |
martin |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
1385 |
02 Sep 11 |
martin |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1385 |
02 Sep 11 |
martin |
GNU General Public License for more details. |
1385 |
02 Sep 11 |
martin |
18 |
|
1385 |
02 Sep 11 |
martin |
You should have received a copy of the GNU General Public License |
1385 |
02 Sep 11 |
martin |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
1385 |
02 Sep 11 |
martin |
21 |
*/ |
1385 |
02 Sep 11 |
martin |
22 |
package net.sf.basedb.illumina.filehandler; |
1385 |
02 Sep 11 |
martin |
23 |
|
1385 |
02 Sep 11 |
martin |
24 |
import net.sf.basedb.core.ArrayDesign; |
1385 |
02 Sep 11 |
martin |
25 |
import net.sf.basedb.core.DbControl; |
1386 |
06 Sep 11 |
nicklas |
26 |
import net.sf.basedb.core.FileSetMember; |
1385 |
02 Sep 11 |
martin |
27 |
import net.sf.basedb.core.InvalidDataException; |
1385 |
02 Sep 11 |
martin |
28 |
import net.sf.basedb.core.InvalidRelationException; |
1385 |
02 Sep 11 |
martin |
29 |
import net.sf.basedb.illumina.Illumina; |
1385 |
02 Sep 11 |
martin |
30 |
import net.sf.basedb.util.fileset.SingleFileValidationAction; |
1385 |
02 Sep 11 |
martin |
31 |
|
1385 |
02 Sep 11 |
martin |
32 |
/** |
1385 |
02 Sep 11 |
martin |
33 |
|
1385 |
02 Sep 11 |
martin |
@author Martin |
1385 |
02 Sep 11 |
martin |
@since 1.7 |
1385 |
02 Sep 11 |
martin |
@base.modified $Date: 2011-05-06 14:09:13 +0200 (Fri, 06 May 2011) $ |
1385 |
02 Sep 11 |
martin |
37 |
*/ |
1385 |
02 Sep 11 |
martin |
38 |
public class SnpCvsValidationAction |
1385 |
02 Sep 11 |
martin |
39 |
extends SingleFileValidationAction |
1385 |
02 Sep 11 |
martin |
40 |
{ |
1385 |
02 Sep 11 |
martin |
41 |
|
1385 |
02 Sep 11 |
martin |
42 |
private final DbControl dc; |
1385 |
02 Sep 11 |
martin |
43 |
private final ArrayDesign design; |
1385 |
02 Sep 11 |
martin |
44 |
private final SnpCvsValidator validator; |
1385 |
02 Sep 11 |
martin |
45 |
|
1385 |
02 Sep 11 |
martin |
46 |
public SnpCvsValidationAction(DbControl dc, ArrayDesign design) |
1385 |
02 Sep 11 |
martin |
47 |
{ |
1385 |
02 Sep 11 |
martin |
48 |
super(Illumina.SNP_MANIFEST_FILE_ID); |
1385 |
02 Sep 11 |
martin |
49 |
this.dc = dc; |
1385 |
02 Sep 11 |
martin |
50 |
this.design = design; |
1385 |
02 Sep 11 |
martin |
51 |
this.validator = new SnpCvsValidator(); |
1385 |
02 Sep 11 |
martin |
52 |
} |
1385 |
02 Sep 11 |
martin |
53 |
|
1385 |
02 Sep 11 |
martin |
54 |
@Override |
1385 |
02 Sep 11 |
martin |
55 |
public void resetMetadata() |
1385 |
02 Sep 11 |
martin |
56 |
{ |
1385 |
02 Sep 11 |
martin |
57 |
validator.resetMetadata(design); |
1385 |
02 Sep 11 |
martin |
58 |
|
1385 |
02 Sep 11 |
martin |
59 |
} |
1385 |
02 Sep 11 |
martin |
60 |
|
1385 |
02 Sep 11 |
martin |
61 |
@Override |
1385 |
02 Sep 11 |
martin |
62 |
public void validateAndExtractMetadata() |
1385 |
02 Sep 11 |
martin |
63 |
throws InvalidDataException, InvalidRelationException |
1385 |
02 Sep 11 |
martin |
64 |
{ |
1386 |
06 Sep 11 |
nicklas |
65 |
FileSetMember member = getAcceptedFile(); |
1386 |
06 Sep 11 |
nicklas |
66 |
validator.copyMetaData(member.getFile(), design); |
1385 |
02 Sep 11 |
martin |
67 |
} |
1385 |
02 Sep 11 |
martin |
68 |
|
1385 |
02 Sep 11 |
martin |
69 |
} |