<commit_before>/*
 *  eXist Open Source Native XML Database
 *  Copyright (C) 2001-2012 The eXist Project
 *  http://exist-db.org
 *
 *  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
 *  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 library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 *  $Id$
 */
package org.exist.client;

import java.util.Date;

import org.exist.xmldb.XmldbURI;

/**
 * Description of a resource, suitable for display by the graphical
 * client for instance.
 *
 * @author gpothier
 */
public abstract class ResourceDescriptor {
    private XmldbURI name;
    private String owner;
    private String group;
    private String permissions;
    private Date date;
    
    public ResourceDescriptor(XmldbURI aName, String aOwner, 
                              String aGroup, String aPermissions, Date date ) {
        name = aName;
        owner = aOwner;
        group = aGroup;
        permissions = aPermissions;
        this.date = date;
    }
    
    public String getGroup() {
        return group;
    }
    
    public XmldbURI getName() {
        return name;
    }
    
    public String getOwner() {
        return owner;
    }
    
    public String getPermissions() {
        return permissions;
    }
    
	public Date getDate() {
		return date;
	}
	
    public abstract boolean isCollection();
    
    public static class Document extends ResourceDescriptor {
        public Document(XmldbURI aName, String aOwner, String aGroup, String aPermissions, Date date) {
            super(aName, aOwner, aGroup, aPermissions, date);
        }
        
        public boolean isCollection() {
            return false;
        }
    }
    
    public static class Collection extends ResourceDescriptor {
        public Collection(XmldbURI aName) {
            super(aName, null, null, null, null);
        }
        
        public Collection(XmldbURI aName, String aOwner, String aGroup, String aPermissions, Date date) {
            super(aName, aOwner, aGroup, aPermissions, date);
        }
        
        public boolean isCollection() {
            return true;
        }
    }
    
}<commit_msg>[ignore] code cleanup<commit_after>/*
 *  eXist Open Source Native XML Database
 *  Copyright (C) 2001-2012 The eXist Project
 *  http://exist-db.org
 *
 *  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
 *  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 library; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 *  $Id$
 */
package org.exist.client;

import java.util.Date;

import org.exist.xmldb.XmldbURI;

/**
 * Description of a resource, suitable for display by the graphical
 * client for instance.
 *
 * @author gpothier
 */
public abstract class ResourceDescriptor {
    private final XmldbURI name;
    private final String owner;
    private final String group;
    private final String permissions;
    private final Date date;
    
    public ResourceDescriptor(final XmldbURI aName, final String aOwner,
            final String aGroup, final String aPermissions, final Date date ) {
        name = aName;
        owner = aOwner;
        group = aGroup;
        permissions = aPermissions;
        this.date = date;
    }
    
    public String getGroup() {
        return group;
    }
    
    public XmldbURI getName() {
        return name;
    }
    
    public String getOwner() {
        return owner;
    }
    
    public String getPermissions() {
        return permissions;
    }
    
    public Date getDate() {
        return date;
    }
	
    public abstract boolean isCollection();
    
    public static class Document extends ResourceDescriptor {
        public Document(final XmldbURI aName, final String aOwner,
                final String aGroup, final String aPermissions, final Date date) {
            super(aName, aOwner, aGroup, aPermissions, date);
        }
        
        @Override
        public boolean isCollection() {
            return false;
        }
    }
    
    public static class Collection extends ResourceDescriptor {
        public Collection(final XmldbURI aName) {
            super(aName, null, null, null, null);
        }
        
        public Collection(final XmldbURI aName, final String aOwner,
                final String aGroup, final String aPermissions, final Date date) {
            super(aName, aOwner, aGroup, aPermissions, date);
        }
        
        @Override
        public boolean isCollection() {
            return true;
        }
    }
    
}
{'fraction_non_alphanumeric': 0.06686715018574209, 'fraction_numerical': 0.0070758889085441356, 'mean_word_length': 2.3396337861783816, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '360754', 'n_tokens_mistral': 1529, 'n_tokens_neox': 1502, 'n_words': 591}