SlideShare a Scribd company logo
Язык Java




Объект File
  java.io
File
●   public static final char separatorChar
●   public static final String separator
●   public static final char pathSeparatorChar
●   public static final String pathSeparator
●   public File(String pathname)
●   public File(String parent, String child)
●   public File(File parent, String child)
●   public File(URI uri)
●   public String getName()
●   public String getParent()
●   public File getParentFile()
●   public String getPath()
●   public boolean isAbsolute()
●   public String getAbsolutePath()
●   public File getAbsoluteFile()
●   public String getCanonicalPath() throws IOException
●   public File getCanonicalFile() throws IOException
File (продолжение)
●   public boolean canRead()
●   public boolean canWrite()
●   public boolean exists()
●   public boolean isDirectory()
●   public boolean isFile()
●   public boolean isHidden()
●   public long lastModified()
●   public long length()
●   public boolean createNewFile() throws IOException
●   public boolean delete()
●   public String[] list()
●   public String[] list(FilenameFilter filter)
●   public File[] listFiles()
●   public File[] listFiles(FilenameFilter filter)
●   public File[] listFiles(FileFilter filter)
●   public boolean mkdir()
●   public boolean mkdirs()
●   public boolean renameTo(File dest)
File (продолжение)
●   public boolean setReadOnly()
●   public boolean setWritable(boolean writable, boolean
    ownerOnly)
●   public boolean setWritable(boolean writable)
●   public boolean setReadable(boolean readable, boolean
    ownerOnly)
●   public boolean setReadable(boolean readable)
●   public boolean setExecutable(boolean executable, boolean
    ownerOnly)
●   public boolean setExecutable(boolean executable)
●   public boolean canExecute()
●   public long getTotalSpace()
●   public long getFreeSpace()
●   public long getUsableSpace()
●   public static File createTempFile(String prefix, String suffix,
    File directory)
●   public static File createTempFile(String prefix, String suffix)
    throws IOException
Пример использования
●   private File f;
    private Date d;
    private File f1;
    public FileTestClass(String name, String name2)
    {
       f1=new File(name);
       d=new Date(f1.lastModified());
       f=new File(name2);
    }

    public String[] outAllFiles()
    {
      File[] fs=f.listFiles(new MyFilter(d));
      String[] ss=new String[fs.length];
      for(int i=0;i<fs.length;++i)
         ss[i]=fs[i].getPath();
      return ss;
    }
Интерфейс FileFilter
●   public interface FileFilter{
      boolean accept(File pathname);
    }
Пример использования

●   public class MyFilter implements FileFilter{
       private Date date;
       public MyFilter(Date date)
      {
          this.date=date;
       }

        public boolean accept(File pathname) {
          Date date1 = new Date(pathname.lastModified());
          return (date.getTime()>=date1.getTime());
        }
    }
Интерфейс FilanameFilter

●   interface FilenameFilter {
       boolean accept(File dir, String name);
    }
Работа со временем

●   class Date
    ●   public Date(long date)
●   class GregorianCalendar
    ●   public GregorianCalendar(int year, int month, int
        dayOfMonth, int hourOfDay, int minute, int second)
    ●   public final Date getTime()
    ●   public final void setTime(Date date)
Конец




            Вопросы
e-mail: a.bovanenko@gmail.com

More Related Content

What's hot

Migrating from drupal to plone with transmogrifier
Migrating from drupal to plone with transmogrifierMigrating from drupal to plone with transmogrifier
Migrating from drupal to plone with transmogrifier
Clayton Parker
 
java copy file program
java copy file programjava copy file program
java copy file program
Glen Pais
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
Geeks Anonymes
 
Go破壊
Go破壊Go破壊
Go破壊
Hattori Hideo
 
Closures for Java
Closures for JavaClosures for Java
Closures for Java
nextlib
 
File input output in Java
File input output in JavaFile input output in Java
File input output in Java
Fiverr
 
C++ prgms io file unit 7
C++ prgms io file unit 7C++ prgms io file unit 7
C++ prgms io file unit 7
Ananda Kumar HN
 
Workshop programs
Workshop programsWorkshop programs
Workshop programs
Kracekumar Ramaraju
 
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization formatMessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
Larry Nung
 
Groovy Update, Groovy Ecosystem, and Gaelyk -- Devoxx 2010 -- Guillaume Laforge
Groovy Update, Groovy Ecosystem, and Gaelyk -- Devoxx 2010 -- Guillaume LaforgeGroovy Update, Groovy Ecosystem, and Gaelyk -- Devoxx 2010 -- Guillaume Laforge
Groovy Update, Groovy Ecosystem, and Gaelyk -- Devoxx 2010 -- Guillaume Laforge
Guillaume Laforge
 
Transmogrifier: Migrating to Plone with less pain
Transmogrifier: Migrating to Plone with less painTransmogrifier: Migrating to Plone with less pain
Transmogrifier: Migrating to Plone with less pain
Lennart Regebro
 
Next Generation Language Go
Next Generation Language GoNext Generation Language Go
Next Generation Language Go
Yoichiro Shimizu
 
Python for Mac Admins
Python for Mac AdminsPython for Mac Admins
Python for Mac Admins
Timothy Sutton
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simple
John Stevenson
 

What's hot (14)

Migrating from drupal to plone with transmogrifier
Migrating from drupal to plone with transmogrifierMigrating from drupal to plone with transmogrifier
Migrating from drupal to plone with transmogrifier
 
java copy file program
java copy file programjava copy file program
java copy file program
 
Geeks Anonymes - Le langage Go
Geeks Anonymes - Le langage GoGeeks Anonymes - Le langage Go
Geeks Anonymes - Le langage Go
 
Go破壊
Go破壊Go破壊
Go破壊
 
Closures for Java
Closures for JavaClosures for Java
Closures for Java
 
File input output in Java
File input output in JavaFile input output in Java
File input output in Java
 
C++ prgms io file unit 7
C++ prgms io file unit 7C++ prgms io file unit 7
C++ prgms io file unit 7
 
Workshop programs
Workshop programsWorkshop programs
Workshop programs
 
MessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization formatMessagePack - An efficient binary serialization format
MessagePack - An efficient binary serialization format
 
Groovy Update, Groovy Ecosystem, and Gaelyk -- Devoxx 2010 -- Guillaume Laforge
Groovy Update, Groovy Ecosystem, and Gaelyk -- Devoxx 2010 -- Guillaume LaforgeGroovy Update, Groovy Ecosystem, and Gaelyk -- Devoxx 2010 -- Guillaume Laforge
Groovy Update, Groovy Ecosystem, and Gaelyk -- Devoxx 2010 -- Guillaume Laforge
 
Transmogrifier: Migrating to Plone with less pain
Transmogrifier: Migrating to Plone with less painTransmogrifier: Migrating to Plone with less pain
Transmogrifier: Migrating to Plone with less pain
 
Next Generation Language Go
Next Generation Language GoNext Generation Language Go
Next Generation Language Go
 
Python for Mac Admins
Python for Mac AdminsPython for Mac Admins
Python for Mac Admins
 
Clojure made really really simple
Clojure made really really simpleClojure made really really simple
Clojure made really really simple
 

Viewers also liked

Vertical Roller Mill Gearbox Reduction Ratio Calculations
Vertical Roller Mill Gearbox Reduction Ratio CalculationsVertical Roller Mill Gearbox Reduction Ratio Calculations
Vertical Roller Mill Gearbox Reduction Ratio Calculations
Syed Fahad Ahmed
 
Hydraulic system vertical roller mill operation
Hydraulic system vertical roller mill operationHydraulic system vertical roller mill operation
Hydraulic system vertical roller mill operation
linxiaomo
 
Clinker cooler's efficiency
Clinker cooler's efficiencyClinker cooler's efficiency
Clinker cooler's efficiency
Emad Sabri
 
Bag filters
Bag filtersBag filters
Bag filters
Egmont Ottermann
 
Red river in clinker cooler
Red river in clinker  coolerRed river in clinker  cooler
Red river in clinker cooler
pradeepdeepi
 
VRM
VRMVRM
VRM
mkpasha
 
Vertical raw mill pradeep kumar
Vertical raw mill pradeep kumarVertical raw mill pradeep kumar
Vertical raw mill pradeep kumar
pradeepdeepi
 

Viewers also liked (7)

Vertical Roller Mill Gearbox Reduction Ratio Calculations
Vertical Roller Mill Gearbox Reduction Ratio CalculationsVertical Roller Mill Gearbox Reduction Ratio Calculations
Vertical Roller Mill Gearbox Reduction Ratio Calculations
 
Hydraulic system vertical roller mill operation
Hydraulic system vertical roller mill operationHydraulic system vertical roller mill operation
Hydraulic system vertical roller mill operation
 
Clinker cooler's efficiency
Clinker cooler's efficiencyClinker cooler's efficiency
Clinker cooler's efficiency
 
Bag filters
Bag filtersBag filters
Bag filters
 
Red river in clinker cooler
Red river in clinker  coolerRed river in clinker  cooler
Red river in clinker cooler
 
VRM
VRMVRM
VRM
 
Vertical raw mill pradeep kumar
Vertical raw mill pradeep kumarVertical raw mill pradeep kumar
Vertical raw mill pradeep kumar
 

Similar to File. Java

Active Software Documentation using Soul and IntensiVE
Active Software Documentation using Soul and IntensiVEActive Software Documentation using Soul and IntensiVE
Active Software Documentation using Soul and IntensiVE
kim.mens
 
DIWE - File handling with PHP
DIWE - File handling with PHPDIWE - File handling with PHP
DIWE - File handling with PHP
Rasan Samarasinghe
 
From Java to Python
From Java to PythonFrom Java to Python
From Java to Python
Alexandre González Rodríguez
 
Lombokの紹介
Lombokの紹介Lombokの紹介
Lombokの紹介
onozaty
 
import required package file import java.io.File; The Filed.pdf
 import required package file import java.io.File; The Filed.pdf import required package file import java.io.File; The Filed.pdf
import required package file import java.io.File; The Filed.pdf
anandinternational01
 
Java Week4(A) Notepad
Java Week4(A)   NotepadJava Week4(A)   Notepad
Java Week4(A) Notepad
Chaitanya Rajkumar Limmala
 
Know how to redirect input and output- and know how to append to an ex.docx
Know how to redirect input and output- and know how to append to an ex.docxKnow how to redirect input and output- and know how to append to an ex.docx
Know how to redirect input and output- and know how to append to an ex.docx
wkelli
 
My History
My HistoryMy History
My History
santosh mishra
 
Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing Part
Gabriele Lana
 
File Handling in C Programming
File Handling in C ProgrammingFile Handling in C Programming
File Handling in C Programming
RavindraSalunke3
 
Various types of File Operations in Java
Various types of  File Operations in JavaVarious types of  File Operations in Java
Various types of File Operations in Java
RanjithaM32
 
History
HistoryHistory
Module 03 File Handling in C
Module 03 File Handling in CModule 03 File Handling in C
Module 03 File Handling in C
Tushar B Kute
 
Session 23 - JDBC
Session 23 - JDBCSession 23 - JDBC
Session 23 - JDBC
PawanMM
 
Oop lecture9 12
Oop lecture9 12Oop lecture9 12
Oop lecture9 12
Shahriar Robbani
 
Chapter 5 Class File
Chapter 5 Class FileChapter 5 Class File
Chapter 5 Class File
Khirulnizam Abd Rahman
 
Application-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageApplication-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta Language
ESUG
 
files.pptx
files.pptxfiles.pptx
files.pptx
KeerthanaM738437
 
Files in c
Files in cFiles in c
Files in c
TanujaA3
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to Wonder
WO Community
 

Similar to File. Java (20)

Active Software Documentation using Soul and IntensiVE
Active Software Documentation using Soul and IntensiVEActive Software Documentation using Soul and IntensiVE
Active Software Documentation using Soul and IntensiVE
 
DIWE - File handling with PHP
DIWE - File handling with PHPDIWE - File handling with PHP
DIWE - File handling with PHP
 
From Java to Python
From Java to PythonFrom Java to Python
From Java to Python
 
Lombokの紹介
Lombokの紹介Lombokの紹介
Lombokの紹介
 
import required package file import java.io.File; The Filed.pdf
 import required package file import java.io.File; The Filed.pdf import required package file import java.io.File; The Filed.pdf
import required package file import java.io.File; The Filed.pdf
 
Java Week4(A) Notepad
Java Week4(A)   NotepadJava Week4(A)   Notepad
Java Week4(A) Notepad
 
Know how to redirect input and output- and know how to append to an ex.docx
Know how to redirect input and output- and know how to append to an ex.docxKnow how to redirect input and output- and know how to append to an ex.docx
Know how to redirect input and output- and know how to append to an ex.docx
 
My History
My HistoryMy History
My History
 
Refactoring In Tdd The Missing Part
Refactoring In Tdd The Missing PartRefactoring In Tdd The Missing Part
Refactoring In Tdd The Missing Part
 
File Handling in C Programming
File Handling in C ProgrammingFile Handling in C Programming
File Handling in C Programming
 
Various types of File Operations in Java
Various types of  File Operations in JavaVarious types of  File Operations in Java
Various types of File Operations in Java
 
History
HistoryHistory
History
 
Module 03 File Handling in C
Module 03 File Handling in CModule 03 File Handling in C
Module 03 File Handling in C
 
Session 23 - JDBC
Session 23 - JDBCSession 23 - JDBC
Session 23 - JDBC
 
Oop lecture9 12
Oop lecture9 12Oop lecture9 12
Oop lecture9 12
 
Chapter 5 Class File
Chapter 5 Class FileChapter 5 Class File
Chapter 5 Class File
 
Application-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta LanguageApplication-Specific Models and Pointcuts using a Logic Meta Language
Application-Specific Models and Pointcuts using a Logic Meta Language
 
files.pptx
files.pptxfiles.pptx
files.pptx
 
Files in c
Files in cFiles in c
Files in c
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to Wonder
 

More from Alexey Bovanenko

Python sqlite3
Python sqlite3Python sqlite3
Python sqlite3
Alexey Bovanenko
 
Python. re
Python. rePython. re
Python. re
Alexey Bovanenko
 
python dict
python dictpython dict
python dict
Alexey Bovanenko
 
Python. Строки
Python. СтрокиPython. Строки
Python. Строки
Alexey Bovanenko
 
Python. Введение
Python. ВведениеPython. Введение
Python. Введение
Alexey Bovanenko
 
Конвертация строковых данных в числовые
Конвертация строковых данных в числовыеКонвертация строковых данных в числовые
Конвертация строковых данных в числовые
Alexey Bovanenko
 
Обработка символов в языке C
Обработка символов в языке CОбработка символов в языке C
Обработка символов в языке C
Alexey Bovanenko
 
Javascript String object
Javascript String objectJavascript String object
Javascript String object
Alexey Bovanenko
 
Конструктор копирования
Конструктор копированияКонструктор копирования
Конструктор копирования
Alexey Bovanenko
 
Tempale Intro
Tempale IntroTempale Intro
Tempale Intro
Alexey Bovanenko
 
transaction. php
transaction. phptransaction. php
transaction. php
Alexey Bovanenko
 
cookie. support by php
cookie. support by phpcookie. support by php
cookie. support by php
Alexey Bovanenko
 
php sessions
php sessionsphp sessions
php sessions
Alexey Bovanenko
 
Java IO. Streams
Java IO. StreamsJava IO. Streams
Java IO. Streams
Alexey Bovanenko
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
Alexey Bovanenko
 
Classes: Number, String, StringBuffer, StringBuilder
Classes: Number, String, StringBuffer, StringBuilderClasses: Number, String, StringBuffer, StringBuilder
Classes: Number, String, StringBuffer, StringBuilder
Alexey Bovanenko
 

More from Alexey Bovanenko (20)

Python sqlite3
Python sqlite3Python sqlite3
Python sqlite3
 
Python. re
Python. rePython. re
Python. re
 
python dict
python dictpython dict
python dict
 
Python. Строки
Python. СтрокиPython. Строки
Python. Строки
 
Python. Введение
Python. ВведениеPython. Введение
Python. Введение
 
Nio java
Nio javaNio java
Nio java
 
Конвертация строковых данных в числовые
Конвертация строковых данных в числовыеКонвертация строковых данных в числовые
Конвертация строковых данных в числовые
 
Assert c
Assert cAssert c
Assert c
 
Обработка символов в языке C
Обработка символов в языке CОбработка символов в языке C
Обработка символов в языке C
 
System c
System cSystem c
System c
 
Javascript functions
Javascript functionsJavascript functions
Javascript functions
 
Javascript String object
Javascript String objectJavascript String object
Javascript String object
 
Конструктор копирования
Конструктор копированияКонструктор копирования
Конструктор копирования
 
Tempale Intro
Tempale IntroTempale Intro
Tempale Intro
 
transaction. php
transaction. phptransaction. php
transaction. php
 
cookie. support by php
cookie. support by phpcookie. support by php
cookie. support by php
 
php sessions
php sessionsphp sessions
php sessions
 
Java IO. Streams
Java IO. StreamsJava IO. Streams
Java IO. Streams
 
Regular Expressions
Regular ExpressionsRegular Expressions
Regular Expressions
 
Classes: Number, String, StringBuffer, StringBuilder
Classes: Number, String, StringBuffer, StringBuilderClasses: Number, String, StringBuffer, StringBuilder
Classes: Number, String, StringBuffer, StringBuilder
 

Recently uploaded

The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 

Recently uploaded (20)

The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 

File. Java

  • 2. File ● public static final char separatorChar ● public static final String separator ● public static final char pathSeparatorChar ● public static final String pathSeparator ● public File(String pathname) ● public File(String parent, String child) ● public File(File parent, String child) ● public File(URI uri) ● public String getName() ● public String getParent() ● public File getParentFile() ● public String getPath() ● public boolean isAbsolute() ● public String getAbsolutePath() ● public File getAbsoluteFile() ● public String getCanonicalPath() throws IOException ● public File getCanonicalFile() throws IOException
  • 3. File (продолжение) ● public boolean canRead() ● public boolean canWrite() ● public boolean exists() ● public boolean isDirectory() ● public boolean isFile() ● public boolean isHidden() ● public long lastModified() ● public long length() ● public boolean createNewFile() throws IOException ● public boolean delete() ● public String[] list() ● public String[] list(FilenameFilter filter) ● public File[] listFiles() ● public File[] listFiles(FilenameFilter filter) ● public File[] listFiles(FileFilter filter) ● public boolean mkdir() ● public boolean mkdirs() ● public boolean renameTo(File dest)
  • 4. File (продолжение) ● public boolean setReadOnly() ● public boolean setWritable(boolean writable, boolean ownerOnly) ● public boolean setWritable(boolean writable) ● public boolean setReadable(boolean readable, boolean ownerOnly) ● public boolean setReadable(boolean readable) ● public boolean setExecutable(boolean executable, boolean ownerOnly) ● public boolean setExecutable(boolean executable) ● public boolean canExecute() ● public long getTotalSpace() ● public long getFreeSpace() ● public long getUsableSpace() ● public static File createTempFile(String prefix, String suffix, File directory) ● public static File createTempFile(String prefix, String suffix) throws IOException
  • 5. Пример использования ● private File f; private Date d; private File f1; public FileTestClass(String name, String name2) { f1=new File(name); d=new Date(f1.lastModified()); f=new File(name2); } public String[] outAllFiles() { File[] fs=f.listFiles(new MyFilter(d)); String[] ss=new String[fs.length]; for(int i=0;i<fs.length;++i) ss[i]=fs[i].getPath(); return ss; }
  • 6. Интерфейс FileFilter ● public interface FileFilter{ boolean accept(File pathname); }
  • 7. Пример использования ● public class MyFilter implements FileFilter{ private Date date; public MyFilter(Date date) { this.date=date; } public boolean accept(File pathname) { Date date1 = new Date(pathname.lastModified()); return (date.getTime()>=date1.getTime()); } }
  • 8. Интерфейс FilanameFilter ● interface FilenameFilter { boolean accept(File dir, String name); }
  • 9. Работа со временем ● class Date ● public Date(long date) ● class GregorianCalendar ● public GregorianCalendar(int year, int month, int dayOfMonth, int hourOfDay, int minute, int second) ● public final Date getTime() ● public final void setTime(Date date)
  • 10. Конец Вопросы e-mail: a.bovanenko@gmail.com