public virtual global::java.io.File[] listFiles(java.io.FilenameFilter arg0) { global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv; if (!IsClrObject) { return(global::MonoJavaBridge.JavaBridge.WrapJavaArrayObject <java.io.File>(@__env.CallObjectMethod(this.JvmHandle, global::java.io.File._listFiles12527, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as java.io.File[]); } else { return(global::MonoJavaBridge.JavaBridge.WrapJavaArrayObject <java.io.File>(@__env.CallNonVirtualObjectMethod(this.JvmHandle, global::java.io.File.staticClass, global::java.io.File._listFiles12527, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as java.io.File[]); } }
/// <summary>Gets a list of the files in the directory represented by this file.</summary> /// <remarks> /// Gets a list of the files in the directory represented by this file. This /// list is then filtered through a FilenameFilter and the names of files /// with matching names are returned as an array of strings. Returns /// <code>null</code> /// if this file is not a directory. If /// <code>filter</code> /// is /// <code>null</code> /// then all filenames match. /// <p> /// The entries /// <code>.</code> /// and /// <code>..</code> /// representing the current and parent /// directories are not returned as part of the list. /// </remarks> /// <param name="filter"> /// the filter to match names against, may be /// <code>null</code> /// . /// </param> /// <returns> /// an array of files or /// <code>null</code> /// . /// </returns> public string[] list(java.io.FilenameFilter filter) { string[] filenames = list(); if (filter == null || filenames == null) { return(filenames); } java.util.List <string> result = new java.util.ArrayList <string>(filenames.Length); foreach (string filename in filenames) { if (filter.accept(this, filename)) { result.add(filename); } } return(result.toArray(new string[result.size()])); }
/// <summary>Gets a list of the files in the directory represented by this file.</summary> /// <remarks> /// Gets a list of the files in the directory represented by this file. This /// list is then filtered through a FilenameFilter and files with matching /// names are returned as an array of files. Returns /// <code>null</code> /// if this /// file is not a directory. If /// <code>filter</code> /// is /// <code>null</code> /// then all /// filenames match. /// <p> /// The entries /// <code>.</code> /// and /// <code>..</code> /// representing the current and parent /// directories are not returned as part of the list. /// </remarks> /// <param name="filter"> /// the filter to match names against, may be /// <code>null</code> /// . /// </param> /// <returns> /// an array of files or /// <code>null</code> /// . /// </returns> public java.io.File[] listFiles(java.io.FilenameFilter filter) { return(filenamesToFiles(list(filter))); }