1 package org.apache.maven.archiva.indexer.filecontent;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
23 import org.apache.maven.archiva.model.ArchivaArtifact;
26 * Lucene record for {@link File} contents.
30 public class FileContentRecord
31 implements LuceneRepositoryContentRecord
33 private String repositoryId;
35 private String filename;
38 * Optional artifact reference for the file content.
40 private ArchivaArtifact artifact;
42 private String contents;
44 public String getRepositoryId()
49 public void setRepositoryId( String repositoryId )
51 this.repositoryId = repositoryId;
54 public String getContents()
59 public void setContents( String contents )
61 this.contents = contents;
64 public String getPrimaryKey()
66 return repositoryId + ":" + filename;
74 result = PRIME * result + ( ( filename == null ) ? 0 : filename.hashCode() );
79 public boolean equals( Object obj )
91 if ( getClass() != obj.getClass() )
96 final FileContentRecord other = (FileContentRecord) obj;
98 if ( filename == null )
100 if ( other.filename != null )
105 else if ( !filename.equals( other.filename ) )
112 public String getFilename()
117 public void setFilename( String filename )
119 this.filename = filename;
122 public ArchivaArtifact getArtifact()
127 public void setArtifact( ArchivaArtifact artifact )
129 this.artifact = artifact;