yes, hudson.FilePath.chmod works
thanks!


On 7 January 2014 20:11, Anatoly Bubenkov <bubenkoff@gmail.com> wrote:

> ah sorry missed that you're about hudson.FilePath.chmod
> i was about File.set<Readable|Writable>
> it does not fail, but does wrong stuff
>
>
> On 7 January 2014 20:08, Jesse Glick <notifications@github.com> wrote:
>
>> In src/main/java/hudson/plugins/mercurial/HgExe.java:
>>
>> >              throw new IOException("Support for credentials currently limited to username/password: " + CredentialsNameProvider.name(credentials));
>> >          }
>> >          return b;
>> >      }
>> >
>> > +    private static int chmod(String filename, int mode) {
>> > +        try {
>> > +            Class<?> fspClass = Class.forName("java.util.prefs.FileSystemPreferences");
>> > +            Method chmodMethod = fspClass.getDeclaredMethod("chmod", String.class, Integer.TYPE);
>> > +            chmodMethod.setAccessible(true);
>> > +            return (Integer)chmodMethod.invoke(null, filename, mode);
>> > +        } catch (Throwable ex) {
>> > +            return -1;
>> > +        }
>> > +    }
>>
>> FilePath.chmod fails on Mac OS? If so, should certainly be filed as a
>> core bug.
>>
>> Anyway you should not call private methods from the JRE. If you need to
>> use something other than FilePath, use java.nio.file utilities to set
>> the file mode, or File.setReadable.
>>
>> —
>> Reply to this email directly or view it on GitHub<https://github.com/jenkinsci/mercurial-plugin/pull/48/files#r8702834>
>> .
>>
>
>
>
> --
> Anatoly Bubenkov
>



-- 
Anatoly Bubenkov