All Downloads are FREE. Search and download functionalities are using the official Maven repository.

system.io.File Maven / Gradle / Ivy

/*
 *  MIT License
 *
 *  Copyright (c) 2022 MASES s.r.l.
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in all
 *  copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *  SOFTWARE.
 */

/**************************************************************************************
 * 
 *      This code was generated from a template using JCOReflector
 * 
 *      Manual changes to this file may cause unexpected behavior in your application.
 *      Manual changes to this file will be overwritten if the code is regenerated.
 * 
 *************************************************************************************/

package system.io;

import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;

// Import section
import microsoft.win32.safehandles.SafeFileHandle;
import system.io.FileMode;
import system.io.FileAccess;
import system.io.FileShare;
import system.io.FileOptions;
import system.DateTime;
import system.io.FileAttributes;
import system.io.FileStream;
import system.io.FileStreamOptions;
import system.io.FileSystemInfo;
import system.io.StreamReader;
import system.io.StreamWriter;
import system.text.Encoding;
import system.threading.tasks.Task;
import system.threading.CancellationToken;


/**
 * The base .NET class managing System.IO.File, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e.
 * 

* * See: https://docs.microsoft.com/en-us/dotnet/api/System.IO.File */ public class File extends NetObject { /** * Fully assembly qualified name: System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e */ public static final String assemblyFullName = "System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"; /** * Assembly name: System.Private.CoreLib */ public static final String assemblyShortName = "System.Private.CoreLib"; /** * Qualified class name: System.IO.File */ public static final String className = "System.IO.File"; static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName); /** * The type managed from JCOBridge. See {@link JCType} */ public static JCType classType = createType(); static JCEnum enumInstance = null; JCObject classInstance = null; static JCType createType() { try { String classToCreate = className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); if (JCOReflector.getDebug()) JCOReflector.writeLog("Creating %s", classToCreate); JCType typeCreated = bridge.GetType(classToCreate); if (JCOReflector.getDebug()) JCOReflector.writeLog("Created: %s", (typeCreated != null) ? typeCreated.toString() : "Returned null value"); return typeCreated; } catch (JCException e) { JCOReflector.writeLog(e); return null; } } void addReference(String ref) throws Throwable { try { bridge.AddReference(ref); } catch (JCNativeException jcne) { throw translateException(jcne); } } /** * Internal constructor. Use with caution */ public File(java.lang.Object instance) throws Throwable { super(instance); if (instance instanceof JCObject) { classInstance = (JCObject) instance; } else throw new Exception("Cannot manage object, it is not a JCObject"); } public String getJCOAssemblyName() { return assemblyFullName; } public String getJCOClassName() { return className; } public String getJCOObjectName() { return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); } public java.lang.Object getJCOInstance() { return classInstance; } public void setJCOInstance(JCObject instance) { classInstance = instance; super.setJCOInstance(classInstance); } public JCType getJCOType() { return classType; } /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link File}, a cast assert is made to check if types are compatible. * @param from {@link IJCOBridgeReflected} instance to be casted * @return {@link File} instance * @throws java.lang.Throwable in case of error during cast operation */ public static File cast(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new File(from.getJCOInstance()); } // Constructors section public File() throws Throwable { } // Methods section public static boolean Exists(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (boolean)classType.Invoke("Exists", path); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static byte[] ReadAllBytes(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.FormatException, system.runtime.serialization.SerializationException, system.io.IOException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { ArrayList resultingArrayList = new ArrayList(); JCObject resultingObjects = (JCObject)classType.Invoke("ReadAllBytes", path); for (java.lang.Object resultingObject : resultingObjects) { resultingArrayList.add(resultingObject); } byte[] resultingArray = new byte[resultingArrayList.size()]; for(int indexReadAllBytes = 0; indexReadAllBytes < resultingArrayList.size(); indexReadAllBytes++ ) { resultingArray[indexReadAllBytes] = (byte)resultingArrayList.get(indexReadAllBytes); } return resultingArray; } catch (JCNativeException jcne) { throw translateException(jcne); } } public static SafeFileHandle OpenHandle(java.lang.String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.runtime.serialization.SerializationException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.io.IOException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objOpenHandle = (JCObject)classType.Invoke("OpenHandle", path, mode == null ? null : mode.getJCOInstance(), access == null ? null : access.getJCOInstance(), share == null ? null : share.getJCOInstance(), options == null ? null : options.getJCOInstance(), preallocationSize); return new SafeFileHandle(objOpenHandle); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static DateTime GetCreationTime(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objGetCreationTime = (JCObject)classType.Invoke("GetCreationTime", path); return new DateTime(objGetCreationTime); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static DateTime GetCreationTimeUtc(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objGetCreationTimeUtc = (JCObject)classType.Invoke("GetCreationTimeUtc", path); return new DateTime(objGetCreationTimeUtc); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static DateTime GetLastAccessTime(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objGetLastAccessTime = (JCObject)classType.Invoke("GetLastAccessTime", path); return new DateTime(objGetLastAccessTime); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static DateTime GetLastAccessTimeUtc(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objGetLastAccessTimeUtc = (JCObject)classType.Invoke("GetLastAccessTimeUtc", path); return new DateTime(objGetLastAccessTimeUtc); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static DateTime GetLastWriteTime(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objGetLastWriteTime = (JCObject)classType.Invoke("GetLastWriteTime", path); return new DateTime(objGetLastWriteTime); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static DateTime GetLastWriteTimeUtc(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objGetLastWriteTimeUtc = (JCObject)classType.Invoke("GetLastWriteTimeUtc", path); return new DateTime(objGetLastWriteTimeUtc); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileAttributes GetAttributes(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objGetAttributes = (JCObject)classType.Invoke("GetAttributes", path); return new FileAttributes(objGetAttributes); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream Create(java.lang.String path, int bufferSize, FileOptions options) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.IndexOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentNullException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.FormatException, system.runtime.serialization.SerializationException, system.io.IOException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objCreate = (JCObject)classType.Invoke("Create", path, bufferSize, options == null ? null : options.getJCOInstance()); return new FileStream(objCreate); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream Create(java.lang.String path, int bufferSize) throws Throwable, system.NotSupportedException, system.ArgumentException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.FormatException, system.IndexOutOfRangeException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objCreate = (JCObject)classType.Invoke("Create", path, bufferSize); return new FileStream(objCreate); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream Create(java.lang.String path) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objCreate = (JCObject)classType.Invoke("Create", path); return new FileStream(objCreate); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream Open(java.lang.String path, FileMode mode, FileAccess access, FileShare share) throws Throwable, system.NotSupportedException, system.ArgumentException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.FormatException, system.IndexOutOfRangeException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objOpen = (JCObject)classType.Invoke("Open", path, mode == null ? null : mode.getJCOInstance(), access == null ? null : access.getJCOInstance(), share == null ? null : share.getJCOInstance()); return new FileStream(objOpen); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream Open(java.lang.String path, FileMode mode, FileAccess access) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objOpen = (JCObject)classType.Invoke("Open", path, mode == null ? null : mode.getJCOInstance(), access == null ? null : access.getJCOInstance()); return new FileStream(objOpen); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream Open(java.lang.String path, FileMode mode) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.ArgumentOutOfRangeException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objOpen = (JCObject)classType.Invoke("Open", path, mode == null ? null : mode.getJCOInstance()); return new FileStream(objOpen); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream Open(java.lang.String path, FileStreamOptions options) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.runtime.serialization.SerializationException, system.io.IOException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objOpen = (JCObject)classType.Invoke("Open", path, options == null ? null : options.getJCOInstance()); return new FileStream(objOpen); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream OpenRead(java.lang.String path) throws Throwable, system.NotSupportedException, system.ArgumentException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.FormatException, system.IndexOutOfRangeException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objOpenRead = (JCObject)classType.Invoke("OpenRead", path); return new FileStream(objOpenRead); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileStream OpenWrite(java.lang.String path) throws Throwable, system.NotSupportedException, system.ArgumentException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.FormatException, system.IndexOutOfRangeException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objOpenWrite = (JCObject)classType.Invoke("OpenWrite", path); return new FileStream(objOpenWrite); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileSystemInfo CreateSymbolicLink(java.lang.String path, java.lang.String pathToTarget) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objCreateSymbolicLink = (JCObject)classType.Invoke("CreateSymbolicLink", path, pathToTarget); return new FileSystemInfo(objCreateSymbolicLink); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static FileSystemInfo ResolveLinkTarget(java.lang.String linkPath, boolean returnFinalTarget) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objResolveLinkTarget = (JCObject)classType.Invoke("ResolveLinkTarget", linkPath, returnFinalTarget); return new FileSystemInfo(objResolveLinkTarget); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static StreamReader OpenText(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objOpenText = (JCObject)classType.Invoke("OpenText", path); return new StreamReader(objOpenText); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static StreamWriter AppendText(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objAppendText = (JCObject)classType.Invoke("AppendText", path); return new StreamWriter(objAppendText); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static StreamWriter CreateText(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objCreateText = (JCObject)classType.Invoke("CreateText", path); return new StreamWriter(objCreateText); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String ReadAllText(java.lang.String path, Encoding encoding) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.OutOfMemoryException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (java.lang.String)classType.Invoke("ReadAllText", path, encoding == null ? null : encoding.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String ReadAllText(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.OutOfMemoryException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { return (java.lang.String)classType.Invoke("ReadAllText", path); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String[] ReadAllLines(java.lang.String path, Encoding encoding) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.OutOfMemoryException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { ArrayList resultingArrayList = new ArrayList(); JCObject resultingObjects = (JCObject)classType.Invoke("ReadAllLines", path, encoding == null ? null : encoding.getJCOInstance()); for (java.lang.Object resultingObject : resultingObjects) { resultingArrayList.add(resultingObject); } java.lang.String[] resultingArray = new java.lang.String[resultingArrayList.size()]; for(int indexReadAllLines = 0; indexReadAllLines < resultingArrayList.size(); indexReadAllLines++ ) { resultingArray[indexReadAllLines] = (java.lang.String)resultingArrayList.get(indexReadAllLines); } return resultingArray; } catch (JCNativeException jcne) { throw translateException(jcne); } } public static java.lang.String[] ReadAllLines(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.OutOfMemoryException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { ArrayList resultingArrayList = new ArrayList(); JCObject resultingObjects = (JCObject)classType.Invoke("ReadAllLines", path); for (java.lang.Object resultingObject : resultingObjects) { resultingArrayList.add(resultingObject); } java.lang.String[] resultingArray = new java.lang.String[resultingArrayList.size()]; for(int indexReadAllLines = 0; indexReadAllLines < resultingArrayList.size(); indexReadAllLines++ ) { resultingArray[indexReadAllLines] = (java.lang.String)resultingArrayList.get(indexReadAllLines); } return resultingArray; } catch (JCNativeException jcne) { throw translateException(jcne); } } public static Task AppendAllTextAsync(java.lang.String path, java.lang.String contents, Encoding encoding, CancellationToken cancellationToken) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objAppendAllTextAsync = (JCObject)classType.Invoke("AppendAllTextAsync", path, contents, encoding == null ? null : encoding.getJCOInstance(), cancellationToken == null ? null : cancellationToken.getJCOInstance()); return new Task(objAppendAllTextAsync); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static Task AppendAllTextAsync(java.lang.String path, java.lang.String contents, CancellationToken cancellationToken) throws Throwable, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.ArgumentException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objAppendAllTextAsync = (JCObject)classType.Invoke("AppendAllTextAsync", path, contents, cancellationToken == null ? null : cancellationToken.getJCOInstance()); return new Task(objAppendAllTextAsync); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static Task WriteAllBytesAsync(java.lang.String path, byte[] bytes, CancellationToken cancellationToken) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.RankException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objWriteAllBytesAsync = (JCObject)classType.Invoke("WriteAllBytesAsync", path, bytes, cancellationToken == null ? null : cancellationToken.getJCOInstance()); return new Task(objWriteAllBytesAsync); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static Task WriteAllBytesAsync(java.lang.String dupParam0, JCORefOut dupParam1, CancellationToken dupParam2) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.RankException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objWriteAllBytesAsync = (JCObject)classType.Invoke("WriteAllBytesAsync", dupParam0, dupParam1.getJCRefOut(), dupParam2 == null ? null : dupParam2.getJCOInstance()); return new Task(objWriteAllBytesAsync); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static Task WriteAllTextAsync(java.lang.String path, java.lang.String contents, Encoding encoding, CancellationToken cancellationToken) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objWriteAllTextAsync = (JCObject)classType.Invoke("WriteAllTextAsync", path, contents, encoding == null ? null : encoding.getJCOInstance(), cancellationToken == null ? null : cancellationToken.getJCOInstance()); return new Task(objWriteAllTextAsync); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static Task WriteAllTextAsync(java.lang.String path, java.lang.String contents, CancellationToken cancellationToken) throws Throwable, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.ArgumentException, system.runtime.serialization.SerializationException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { JCObject objWriteAllTextAsync = (JCObject)classType.Invoke("WriteAllTextAsync", path, contents, cancellationToken == null ? null : cancellationToken.getJCOInstance()); return new Task(objWriteAllTextAsync); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void AppendAllText(java.lang.String path, java.lang.String contents, Encoding encoding) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("AppendAllText", path, contents, encoding == null ? null : encoding.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void AppendAllText(java.lang.String path, java.lang.String contents) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("AppendAllText", path, contents); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Copy(java.lang.String sourceFileName, java.lang.String destFileName, boolean overwrite) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.RankException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.io.IOException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Copy", sourceFileName, destFileName, overwrite); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Copy(java.lang.String sourceFileName, java.lang.String destFileName) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.io.IOException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Copy", sourceFileName, destFileName); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Decrypt(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Decrypt", path); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Delete(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Delete", path); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Encrypt(java.lang.String path) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Encrypt", path); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Move(java.lang.String sourceFileName, java.lang.String destFileName, boolean overwrite) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.RankException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.io.FileNotFoundException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Move", sourceFileName, destFileName, overwrite); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Move(java.lang.String sourceFileName, java.lang.String destFileName) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.io.FileNotFoundException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Move", sourceFileName, destFileName); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Replace(java.lang.String sourceFileName, java.lang.String destinationFileName, java.lang.String destinationBackupFileName, boolean ignoreMetadataErrors) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Replace", sourceFileName, destinationFileName, destinationBackupFileName, ignoreMetadataErrors); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void Replace(java.lang.String sourceFileName, java.lang.String destinationFileName, java.lang.String destinationBackupFileName) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("Replace", sourceFileName, destinationFileName, destinationBackupFileName); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void SetAttributes(java.lang.String path, FileAttributes fileAttributes) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("SetAttributes", path, fileAttributes == null ? null : fileAttributes.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void SetCreationTime(java.lang.String path, DateTime creationTime) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.InvalidTimeZoneException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException, system.OverflowException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("SetCreationTime", path, creationTime == null ? null : creationTime.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void SetCreationTimeUtc(java.lang.String path, DateTime creationTimeUtc) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.security.SecurityException, system.OverflowException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("SetCreationTimeUtc", path, creationTimeUtc == null ? null : creationTimeUtc.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void SetLastAccessTime(java.lang.String path, DateTime lastAccessTime) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.InvalidTimeZoneException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException, system.OverflowException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("SetLastAccessTime", path, lastAccessTime == null ? null : lastAccessTime.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void SetLastAccessTimeUtc(java.lang.String path, DateTime lastAccessTimeUtc) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.security.SecurityException, system.OverflowException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("SetLastAccessTimeUtc", path, lastAccessTimeUtc == null ? null : lastAccessTimeUtc.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void SetLastWriteTime(java.lang.String path, DateTime lastWriteTime) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.InvalidTimeZoneException, system.security.SecurityException, system.UnauthorizedAccessException, system.io.IOException, system.OverflowException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("SetLastWriteTime", path, lastWriteTime == null ? null : lastWriteTime.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void SetLastWriteTimeUtc(java.lang.String path, DateTime lastWriteTimeUtc) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.security.SecurityException, system.OverflowException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("SetLastWriteTimeUtc", path, lastWriteTimeUtc == null ? null : lastWriteTimeUtc.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void WriteAllBytes(java.lang.String path, byte[] bytes) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.RankException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.runtime.serialization.SerializationException, system.io.IOException, system.threading.WaitHandleCannotBeOpenedException, system.threading.AbandonedMutexException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("WriteAllBytes", path, bytes); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void WriteAllBytes(java.lang.String dupParam0, JCORefOut dupParam1) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.RankException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.runtime.serialization.SerializationException, system.io.IOException, system.threading.WaitHandleCannotBeOpenedException, system.threading.AbandonedMutexException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("WriteAllBytes", dupParam0, dupParam1.getJCRefOut()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void WriteAllLines(java.lang.String path, java.lang.String[] contents, Encoding encoding) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("WriteAllLines", path, contents, encoding == null ? null : encoding.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void WriteAllLines(java.lang.String dupParam0, JCORefOut dupParam1, Encoding dupParam2) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("WriteAllLines", dupParam0, dupParam1.getJCRefOut(), dupParam2 == null ? null : dupParam2.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void WriteAllLines(java.lang.String path, java.lang.String[] contents) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("WriteAllLines", path, contents); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void WriteAllLines(java.lang.String dupParam0, JCORefOut dupParam1) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.ObjectDisposedException, system.RankException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("WriteAllLines", dupParam0, dupParam1.getJCRefOut()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void WriteAllText(java.lang.String path, java.lang.String contents, Encoding encoding) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("WriteAllText", path, contents, encoding == null ? null : encoding.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public static void WriteAllText(java.lang.String path, java.lang.String contents) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.ArrayTypeMismatchException, system.IndexOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException { if (classType == null) throw new UnsupportedOperationException("classType is null."); try { classType.Invoke("WriteAllText", path, contents); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Properties section // Instance Events section }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy