1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.codehaus.plexus.archiver.util;
17
18 import java.io.File;
19 import java.io.IOException;
20
21 import org.codehaus.plexus.archiver.ArchiverException;
22 import org.codehaus.plexus.components.io.attributes.AttributeUtils;
23 import org.codehaus.plexus.util.Os;
24 import org.slf4j.Logger;
25
26 @SuppressWarnings("JavaDoc")
27 public final class ArchiveEntryUtils {
28
29 private ArchiveEntryUtils() {
30
31 }
32
33
34
35
36
37
38
39
40
41 @Deprecated
42 public static void chmod(final File file, final int mode, final Logger logger, boolean useJvmChmod)
43 throws ArchiverException {
44 chmod(file, mode);
45 }
46
47
48
49
50
51
52
53
54 @Deprecated
55 public static void chmod(final File file, final int mode, final Logger logger) throws ArchiverException {
56 chmod(file, mode);
57 }
58
59 public static void chmod(final File file, final int mode) throws ArchiverException {
60 if (!Os.isFamily(Os.FAMILY_UNIX)) {
61 return;
62 }
63
64 try {
65 AttributeUtils.chmod(file, mode);
66 } catch (IOException e) {
67 throw new ArchiverException("Failed setting file attributes", e);
68 }
69 }
70 }