package hudson.plugins.tasks.util;

import hudson.model.AbstractBuild;
import hudson.plugins.tasks.util.model.AnnotationContainer;
import hudson.plugins.tasks.util.model.WorkspaceFile;

import java.util.Collection;

/**
 * Result object to visualize the package statistics of a module.
 *
 * @author Ulli Hafner
 */
public class FileDetail extends AbstractAnnotationsDetail {
    /** Unique identifier of this class. */
    private static final long serialVersionUID = -5315146140343619856L;
    /** The package to show the details for. */
    private final WorkspaceFile file;

    /**
     * Creates a new instance of <code>ModuleDetail</code>.
     *
     * @param owner
     *            current build as owner of this action.
     * @param file
     *            the file to show the details for
     * @param header
     *            header to be shown on detail page
     */
    public FileDetail(final AbstractBuild<?, ?> owner, final WorkspaceFile file, final String header) {
        super(owner, file.getAnnotations(), header, Hierarchy.FILE);
        this.file = file;
    }

    /**
     * Returns the header for the detail screen.
     *
     * @return the header
     */
    @Override
    public String getHeader() {
        return getName() + " - File " + file.getShortName();
    }

    /** {@inheritDoc} */
    public String getDisplayName() {
        return file.getShortName();
    }

    /** {@inheritDoc} */
    @Override
    protected Collection<? extends AnnotationContainer> getChildren() {
        return getFiles();
    }
}


@@ -179,16 +179,44 @@
 eFile;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -1569,12 +1569,471 @@
 );%0A    %7D
+%0A%0A    /** %7B@inheritDoc%7D */%0A    @Override%0A    public Collection%3CWorkspaceFile%3E getFiles() %7B%0A        ArrayList%3CWorkspaceFile%3E files = new ArrayList%3CWorkspaceFile%3E();%0A        files.add(file);%0A        return files;%0A    %7D%0A%0A    /** %7B@inheritDoc%7D */%0A    @Override%0A    public WorkspaceFile getFile(final int hashCode) %7B%0A        return file;%0A    %7D%0A%0A    /** %7B@inheritDoc%7D */%0A    @Override%0A    public WorkspaceFile getFile(final String name) %7B%0A        return file;%0A    %7D
 %0A%7D%0A%0A

Implement special case getFiles for FileDetail to return this.