<commit_before>/*
    JSPWiki - a JSP-based WikiWiki clone.

    Copyright (C) 2001-2002 <NAME> (<EMAIL>)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package com.ecyrd.jspwiki.attachment;

import com.ecyrd.jspwiki.WikiEngine;
import com.ecyrd.jspwiki.WikiPage;

/**
 *  Describes an attachment.  Attachments are actually derivatives of
 *  a WikiPage, since they do actually have a WikiName as well.
 *
 *  @author <NAME>
 *  @author <NAME>
 */
public class Attachment
    extends WikiPage
{
    private String m_fileName;
    private String m_parentName;
    private int    m_status = CREATED;
    private boolean m_cacheable = true;

    public static final int CREATED       = 0;
    public static final int UPLOADING     = 1;
    public static final int COMPLETE      = 2;

    /**
     *  Creates a new attachment.  The final name of the attachment will be 
     *  a synthesis of the parent page name and the file name.
     *  
     *  @param engine     The WikiEngine which is hosting this attachment.
     *  @param parentPage The page which will contain this attachment.
     *  @param fileName   The file name for the attachment.
     */
    public Attachment( WikiEngine engine, String parentPage, String fileName )
    {
        super( engine, parentPage+"/"+fileName );

        m_parentName = parentPage;
        m_fileName   = fileName;
    }

    /**
     *  Returns a human-readable, only-debugging-suitable description.
     */
    public String toString()
    {
        return "Attachment ["+getName()+";mod="+getLastModified()+
               ";status="+m_status+"]";
    }

    /**
     *  Returns the file name of the attachment.
     *  
     *  @return A String with the file name.
     */
    public String getFileName()
    {
        return m_fileName;
    }

    /**
     *  Sets the file name of this attachment. 
     *  
     *  @param name The name of the attachment.  Must be a legal file name without
     *              the path.
     */
    public void setFileName( String name )
    {
        m_fileName = name;
    }

    public int getStatus()
    {
        return m_status;
    }

    public void setStatus( int status )
    {
        m_status = status;
    }

    /**
     *  Returns the name of the parent of this Attachment, i.e. the page
     *  which contains this attachment.
     *  
     *  @return String depicting the parent of the attachment.
     */
    public String getParentName()
    {
        return m_parentName;
    }
<commit_msg>Removed obsolete code.<commit_after>/*
    JSPWiki - a JSP-based WikiWiki clone.

    Copyright (C) 2001-2002 <NAME> (<EMAIL>)

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
package com.ecyrd.jspwiki.attachment;

import com.ecyrd.jspwiki.WikiEngine;
import com.ecyrd.jspwiki.WikiPage;

/**
 *  Describes an attachment.  Attachments are actually derivatives of
 *  a WikiPage, since they do actually have a WikiName as well.
 *
 *  @author <NAME>
 *  @author <NAME>
 */
public class Attachment
    extends WikiPage
{
    private String m_fileName;
    private String m_parentName;
    private boolean m_cacheable = true;

    /**
     *  Creates a new attachment.  The final name of the attachment will be 
     *  a synthesis of the parent page name and the file name.
     *  
     *  @param engine     The WikiEngine which is hosting this attachment.
     *  @param parentPage The page which will contain this attachment.
     *  @param fileName   The file name for the attachment.
     */
    public Attachment( WikiEngine engine, String parentPage, String fileName )
    {
        super( engine, parentPage+"/"+fileName );

        m_parentName = parentPage;
        m_fileName   = fileName;
    }

    /**
     *  Returns a human-readable, only-debugging-suitable description.
     *  
     *  @return A debugging string
     */
    public String toString()
    {
        return "Attachment ["+getName()+";mod="+getLastModified()+"]";
    }

    /**
     *  Returns the file name of the attachment.
     *  
     *  @return A String with the file name.
     */
    public String getFileName()
    {
        return m_fileName;
    }

    /**
     *  Sets the file name of this attachment. 
     *  
     *  @param name The name of the attachment.  Must be a legal file name without
     *              the path.
     */
    public void setFileName( String name )
    {
        m_fileName = name;
    }
/*
    public int getStatus()
    {
        return m_status;
    }

    public void setStatus( int status )
    {
        m_status = status;
    }
*/
    /**
     *  Returns the name of the parent of this Attachment, i.e. the page
     *  which contains this attachment.
     *  
     *  @return String depicting the parent of the attachment.
     */
    public String getParentName()
    {
        return m_parentName;
    }

{'fraction_non_alphanumeric': 0.072277545775779, 'fraction_numerical': 0.00819145518792162, 'mean_word_length': 2.322838847385272, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '127958', 'n_tokens_mistral': 1785, 'n_tokens_neox': 1722, 'n_words': 701}