• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IQSS / dataverse / #22002

01 Apr 2024 07:56PM CUT coverage: 20.716% (+0.5%) from 20.173%
#22002

push

github

web-flow
Merge pull request #10453 from IQSS/develop

Merge 6.2 into master

704 of 2679 new or added lines in 152 files covered. (26.28%)

81 existing lines in 49 files now uncovered.

17160 of 82836 relevant lines covered (20.72%)

0.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/java/edu/harvard/iq/dataverse/engine/command/impl/GetDataFileCommand.java
1
/*
2
 * To change this license header, choose License Headers in Project Properties.
3
 * To change this template file, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
package edu.harvard.iq.dataverse.engine.command.impl;
7

8
import edu.harvard.iq.dataverse.DataFile;
9
import edu.harvard.iq.dataverse.authorization.Permission;
10
import edu.harvard.iq.dataverse.engine.command.AbstractCommand;
11
import edu.harvard.iq.dataverse.engine.command.CommandContext;
12
import edu.harvard.iq.dataverse.engine.command.DataverseRequest;
13
import edu.harvard.iq.dataverse.engine.command.exception.CommandException;
14

15
import java.util.Collections;
16
import java.util.Map;
17
import java.util.Set;
18

19
/**
20
 * @author Matthew
21
 */
22
// no annotations here, since permissions are dynamically decided
23
// based off GetDatasetCommand for similar permissions checking
24
public class GetDataFileCommand extends AbstractCommand<DataFile> {
25

26
    private final DataFile dataFile;
27

28
    public GetDataFileCommand(DataverseRequest aRequest, DataFile dataFile) {
NEW
29
        super(aRequest, dataFile);
×
NEW
30
        this.dataFile = dataFile;
×
UNCOV
31
    }
×
32

33
    @Override
34
    public DataFile execute(CommandContext ctxt) throws CommandException {
NEW
35
        return dataFile;
×
36
    }
37

38
    @Override
39
    public Map<String, Set<Permission>> getRequiredPermissions() {
40
        return Collections.singletonMap("",
×
NEW
41
                dataFile.isReleased() ? Collections.emptySet()
×
NEW
42
                        : Collections.singleton(Permission.ViewUnpublishedDataset));
×
43
    }
44
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc