1 /*******************************************************************************
2 * Copyright (c) 2004, 2015 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 * Marc-Andre Laperle <marc-andre.laperle@ericsson.com> - Copied to Trace Compass to work around bug 501379
11 *******************************************************************************/
12 package org
.eclipse
.tracecompass
.internal
.tmf
.ui
.project
.wizards
.importtrace
;
15 * Representation of a file in a tar archive.
17 public class TarEntry
implements Cloneable
20 private long mode
, time
, size
;
25 * Entry type for normal files.
27 public static final int FILE
= '0';
30 * Entry type for directories.
32 public static final int DIRECTORY
= '5';
35 * Create a new TarEntry for a file of the given name at the
36 * given position in the file.
38 * @param name filename
39 * @param pos position in the file in bytes
41 TarEntry(String name
, int pos
) {
46 time
= System
.currentTimeMillis() / 1000;
50 * Create a new TarEntry for a file of the given name.
52 * @param name filename
54 public TarEntry(String name
) {
59 * Returns the type of this file, one of FILE, LINK, SYM_LINK,
60 * CHAR_DEVICE, BLOCK_DEVICE, DIRECTORY or FIFO.
64 public int getFileType() {
69 * Returns the mode of the file in UNIX permissions format.
73 public long getMode() {
78 * Returns the name of the file.
82 public String
getName() {
87 * Returns the size of the file in bytes.
91 public long getSize() {
96 * Returns the modification time of the file in seconds since January
101 public long getTime() {
106 * Sets the type of the file, one of FILE, LINK, SYMLINK, CHAR_DEVICE,
107 * BLOCK_DEVICE, or DIRECTORY.
109 * @param type the file type
111 public void setFileType(int type
) {
116 * Sets the mode of the file in UNIX permissions format.
118 * @param mode the mode
120 public void setMode(long mode
) {
125 * Sets the size of the file in bytes.
127 * @param size the file size
129 public void setSize(long size
) {
134 * Sets the modification time of the file in seconds since January
137 * @param time the modification time
139 public void setTime(long time
) {
This page took 0.037283 seconds and 5 git commands to generate.